Alt pointer support for vector

Paolo Carlini paolo.carlini@oracle.com
Fri Oct 10 08:26:00 GMT 2008


Hi,
> Thanks Paolo.  I will take care of everything you mentioned (incl.
> _ExtPtr_allocator), and post up a SVN diff when done.
>
> I do want to double check one thing:  The static_pointer_cast<>
> functions for _Pointer_adapter were deliberately missing the usual
> underscores.  I had intended to make that pointer follow the API
> conventions for extended pointers that TR1 laid out with shared_ptr.  
> So there was a specific reason why that didn't match GNU standards. 
> That said, I will change it to __static_pointer_cast<> if you still
> want me to.
Yes, please. Really, there is *no* exception to the fact that *anything*
not appearing in the Standard must be "uglified". In fact, we still have
some files around missing that treatment but please do not learn from
bad examples... ;)
> There are two minor material changes that I also will include in the
> new patch:
>
> (a) The _Pointer_adapter will inherit from its Storage_policy, so that
> in the case of smart pointer implementations, the API of the pointer
> can be extended via inheritance, and the associated allocator can take
> advantage of the additional APIs.  This idea came from discussions
> with Phil Bouchard, and helped meet some of his specific needs.
>
> (b) The _Pointer_adapter should do pointer comparison by using an
> operator==() / operator<() from the Storage_policy passed to it, and
> not by comparing the native pointer values.  In certain segmented
> memory schemes, it is possible that comparing the native pointer value
> in different processes would yield different, invalid results in
> different processes.
Excellent.
> I am involved in a lot of work at present.  It may take me from a few
> days to a week to send these changes up to you.
No problem. By now we agreed on the basic idea and all the additional
changes involve only material in ext/ or testcases, thus are safe to go
in even rather late in the release process.

Paolo.



More information about the Libstdc++ mailing list