[boost-users][container] associative placement insertion
Hi, all! I'm wondering how placement insertion works for pair-associative Boost.Container types. For example, given: //[ex_code struct D { D(char,char) {} // Insert Boost.Move awareness here... }; boost::container::map<int,D> my_map; //] Will my_map.emplace(0, 't', 'p') call D('t', 'p') and move the object into the map? Will Boost.Unordered work the same way? TIA! Cromwell D. Enage
I'm wondering how placement insertion works for pair-associative Boost.Container types.
For example, given:
//[ex_code struct D { D(char,char) {} // Insert Boost.Move awareness here... }; boost::container::map<int,D> my_map; //]
Will my_map.emplace(0, 't', 'p') call D('t', 'p') and move the object into the map?
Will Boost.Unordered work the same way?
I've answered these questions but ran into another. Boost.Unordered `emplace()` calls return `std::pair<iterator,bool>` rather than `iterator`. Furthermore, MSVC 2010's TR1.Unordered `emplace()` implementation accepts only one argument: `std::pair<int,D>` in this case. Is this expected? Cromwell D. Enage
participants (1)
-
Cromwell Enage