I have never worked with maps before, but am playing around with them to solve a problem that we have at work. (I won't detail it again here, as I have mentioned it elsewhere !)
Basically I have a map defined as std::map<Foo,Bar> where foo is an enumerated type, and bar is a struct that coresponds to that type.
When I attempt to insert data into the map I get the error Cannot convert element 1 from foo to std::_tree<>::iterator
eg,
enum FOO {AB,CD};
struct validator_AB : public validator_base {....};
validator_AB myAB;
validator_CD myCD;
std::map<FOO,validator_base>;
myMap.insert(AB,validator_AB);
myMap.insert(CD,validator_CD);
OK, it has to be something easy, but what ? (apologies if this is in the book, but thats at home, and the technet CD's don't make the answer obvious to me, being as I am a bear of little brain.
Cheers,
K
Basically I have a map defined as std::map<Foo,Bar> where foo is an enumerated type, and bar is a struct that coresponds to that type.
When I attempt to insert data into the map I get the error Cannot convert element 1 from foo to std::_tree<>::iterator
eg,
enum FOO {AB,CD};
struct validator_AB : public validator_base {....};
validator_AB myAB;
validator_CD myCD;
std::map<FOO,validator_base>;
myMap.insert(AB,validator_AB);
myMap.insert(CD,validator_CD);
OK, it has to be something easy, but what ? (apologies if this is in the book, but thats at home, and the technet CD's don't make the answer obvious to me, being as I am a bear of little brain.
Cheers,
K