Boost logo

Boost :

Subject: [boost] [ptr_container] associative container insert takes reference instead of const reference as key ?
From: comic fans (comicfans44_at_[hidden])
Date: 2018-08-27 13:03:34


Hello , I've found that ptr_unordered_map.insert has following
signature (from code and latest doc)

std::pair<iterator,bool> insert( key_type& k, T* x );

that forbids calls like ptr_unordered_map.insert( myobj->id(), myobj)
,I wonder if this is by design , or some other reason ? why other
overload takes const key_type& k as key type? and insert always call
insert_impl which have const reference as key type ? any help would
be appreciated.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk