Alt pointer support for vector

Bob Walters bob.s.walters@gmail.com
Tue Aug 26 04:50:00 GMT 2008


Paolo,

Attached is the diff containing the alternative pointer support for  
vector, along with all necessary infrastructure and test cases.  All  
of this is working.

The pointer class (_Pointer_adapter) has been deliberately given an  
API that resembles tr1::shared_ptr extended to include pointer  
arithmetic & comparison support, and so on.  Let me know if anything  
needs to change, and feel free to change anything.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nonstd_pointer.patch
Type: application/octet-stream
Size: 52695 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080826/de1c252c/attachment.obj>
-------------- next part --------------



Once this is approved, I can send up stl_tree, and will then work on  
the other types.

Smart pointers are a real problem in the container design, because  
their expectation that they point to heap allocated memory regions  
interferes with 'pointer as iterator' idioms like those used by  
vector.  However, I have an approach which can support them, and will  
write it up when time allows.

- Bob



More information about the Libstdc++ mailing list