Implementation of forward_list (and compressed_pair)

Ed Smith-Rowland 3dw4rd@verizon.net
Tue Oct 14 01:23:00 GMT 2008


Paolo Carlini wrote:
> Hi,
>   
>> To be honest, I was more focused on forward_list and treated
>> compressed_pair more as a place holder albeit one that did what it
>> needs to do.  I studied some other implementations and put something
>> together.  I tested the sizeof and it did the trick.
>>
>> I did think the single argument ctors were unnatural.  I couldn't see
>> myself using them because of the ambiguities just mentioned and, well,
>> it's a *pair* after all.  I'm working on a version where I remove all
>> single argument ctors.
>>
>> I also removed the ifdef.  I'm going with the dummy member for reasons
>> outlined in the comment.
>>     
> Ok, great.
>   
>> Also. I'm using some C++-09 features.  It was convenient.  If this is
>> really going to get used in other containers it might be good to roll
>> back to C++-03 features.  That way, the other containers will used
>> compressed pair allocators before C++-09 becomes default.  I think we
>> have internal replacements for remove_cv and such.
>>     
> Uhhmm, I didn't consider that issue. In fact, as an independently useful
> extension, it would be nice if it could work also in C++03 mode. All in
> all, I'm thinking we should probably change a bit our plans, if you
> agree: let's separate the two projects, the main one being forward_list.
> I would ask you to contribute first a self-contained forward_list, using
> tuple for the pair of allocators. That could go in almost immediately. I
> still believe a __compressed_pair makes sense as an extension, but we
> should probably perfect it separately, and do our best to avoid relying
> on C++03 features for it (TR1 is fine). What do you think? Is it too
> much work for you to quickly split out a self-contained forward_list
> using std::tuple?
>
> Paolo.
>
>   
Nope.

Here it is.

Ed.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: CL_forward_list
Type: application/octet-stream
Size: 2488 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20081014/ecff071a/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: forward_list.patch
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20081014/ecff071a/attachment.ksh>


More information about the Libstdc++ mailing list