unordered containers emplace

Paolo Carlini paolo.carlini@oracle.com
Wed Dec 7 20:44:00 GMT 2011


Hi,

On 12/07/2011 09:37 PM, François Dumont wrote:
> On 12/07/2011 01:01 PM, Paolo Carlini wrote:
>> Hi,
>>> Hi
>>>
>>>     This is the implementation of emplace and emplace_hint for 
>>> unordered containers. For the moment in emplace_hint the hint 
>>> iterator is not considered like in the current insert with hint 
>>> implementation.
>> detail: for consistency with _M_insert, I think we should swap the 
>> arguments of _M_emplace, last true_type / false_type.
>     This is what I did to begin but it failed to compile, g++ do not 
> know then when to stop considering arguments as part of the _Args.... 
> I consider it was a normal limitation of using variadic templates, if 
> so I can invert parameters of _M_insert to have consistency.
Of course, sorry. This is absolutely expected, I just didn't consider, 
formally, that _M_insert is not variadic.
>>
>> 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.
>     Good point, I hadn't notice this potential issue. I am lucky that 
> the library is well designed making my patch not so bad. I will add 
> the necessary tests and resubmit a patch.
Essentially, I would just recommend adding some tests per Jon's comment.

Thanks!
Paolo.



More information about the Libstdc++ mailing list