c++ - insert to boost unordered map -


hi i'm trying insert record boost::unordered_map

map defined

boost::unordered_map<int,input> input_l1_map; 

where input class

class input {          int id;         std::string name;         std::string desc;         std::string short_name;         std::string signal_presence;         std::string xpnt;         } 

i use function insert record below

void runtimedata::hash_table(int id,input input) {    this->input_l1_map.insert(id,input);  } 

i read boost documentation says function insert() insert data container, when compile shows error.

where find such insert method?

  std::pair<iterator, bool> insert(value_type const&);   std::pair<iterator, bool> insert(value_type&&);   iterator insert(const_iterator, value_type const&);   iterator insert(const_iterator, value_type&&);   template<typename inputiterator> void insert(inputiterator, inputiterator); 

where value_type is

  typedef key                                    key_type;               typedef std::pair<key const, mapped>           value_type; 

from here

you should use this->input_l1_map.insert(std::make_pair(id, input));


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -