Initializing map and set class member variables to empty in C++? -


i have c++ class 2 member variables

std::map<int, node*> a; 

and

std::set<node*> b; 

a style checker used @ university requires member variables initialized in constructor of class. how can these member variables a , b initialized empty in constructor of class in?

like this:

class {   public :    a() : s(),         m()   {   }     std::set< int > s;   std::map< int, double > m; }; 

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -