Gu0sur20
Gu0sur20

Reputation: 63

C++ map template and primitive types

I'm not familiar with STL and my brain is bugging with the map template. Is it ok to declare a variable as map<unsigned long, const char*> ? Can I call the clear() function with such a type ?

Thanks.

Upvotes: 0

Views: 262

Answers (1)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272812

Yes.

I guess your concern may be about whether delete is invoked on each const char * when you call clear(). The answer to that is: no.

Upvotes: 1

Related Questions