unordered containers emplace

Jonathan Wakely jwakely.gcc@gmail.com
Wed Dec 7 13:14:00 GMT 2011


On 7 December 2011 12:01, Paolo Carlini wrote:
> Much more importantly, I don't think we are doing the right thing for map /
> multimap; honestly I cannot say to have followed in any special detail the
> standardization of the piecewise_construct_t things, at the corresponding
> ISO Meetings, but I think we have to involve that pair constructor in this
> case. I'm adding Jon and Chris in CC for you to have more help on this,
> please also have a look to various papers authored by Pablo Halpern et al
> over the last 2/3 years.
>

I might be wrong, as I'm only going by reading the cotnainer
requirements not all the past discussion, but I think emplace should
just do alloc.construct(p, std::forward<Args>(args)...)

If the value_type is a std::pair and the user wants to create it with
more than two arguments, they can call emplace( piecewise_construct,
make_tuple(...), make_tuple(...) )

I don't think the library should call the piecewise constructor
directly, only when the function parameter pack contains
piecewise_construct_t, and the right constructor will be chosen by
normal overload resolution.



More information about the Libstdc++ mailing list