Construct maps initialization problem

Hi all,
I've a problem with the map construct. I wrote this class in which there are maps:

1
2
3
4
5
6
7
8
9
class Features 
{
private:
	map<const string,GenericFeatureContainer*> featuremap;
	map<const string,GenericFeatureContainer*>::iterator it;
	int size;
public:

}


and I have the following constructor:

1
2
3
4
5
6
7
Features::Features()
{
	map<NULL,NULL> featuremap;
	it=NULL;
	size=0;
	
}


is that correct? otherwise what is the correct syntax?

Thanks to all and sorry for the trouble!!
NULL and const std::string are different types. You need not to initialize std::map. The constructor of each class member will be called implicitly. So the only data member that need to be initialized is size (though I do not know what it means. If it corresponds to the value of std::map's member function size() then it should be removed).

Features::Features() : size( 0 ) {}
Perfect :) Thanks a lot! :D
Topic archived. No new replies allowed.