Hi I'm trying to insert a record into a boost::unordered_map
Map is defined as
boost::unordered_map<int,Input> input_l1_map;
where Input is the class
class Input {
int id;
std::string name;
std::string desc;
std::string short_name;
std::string signal_presence;
std::string xpnt;
}
I use a function to insert the record as below
void RuntimeData::hash_table(int id,Input input)
{
this->input_l1_map.insert(id,input);
}
I read the boost documentation it says a function insert()
to insert data to the container, but when I compile it shows error.
Where you find such
insert
method?Where
value_type
isfrom here
You should use
this->input_l1_map.insert(std::make_pair(id, input));