This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Alt pointer support for vector
- From: Bob Walters <bob dot s dot walters at gmail dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 26 Aug 2008 00:49:12 -0400
- Subject: Alt pointer support for vector
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.
Attachment:
nonstd_pointer.patch
Description: Binary data
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