
Howard Hinnant skrev:
On Sep 24, 2009, at 10:02 AM, Thorsten Ottosen wrote:
It doesn't quite address my first issue though, namely that I need to construct the mapped value in the node, and then compute the key from this mapped value (after some modification).
I think if the node_ptr class had
a) a forwarding (Key,Value) constructor
b) an emplacing constructor that constructed the pair with (Key,...)
then I could do exactly what I needed :-)
With what allocator would the node_ptr allocate the node?
Ok, I guess that is why I originally spoke about the following interface: typedef ... map; map m; map::node_ptr p = m.get_node_ptr(<like emplace, but only for constructing the mapped value>); p->pair.first = modify( p->pair.second ); m.insert( boost::move(p) ); So get_node_ptr( ... ) with two overloads would be needed. -Thorsten