Topic: Proposal: boost::ptr<> smart pointer


Author: "Philippe A. Bouchard" <philippeb@videotron.ca>
Date: Tue, 27 Aug 2002 16:10:02 CST
Raw View
Hi,

    I (with Ron's help) just found out C++ was flawless and I would like to
propose ptr.hpp:
http://groups.yahoo.com/group/boost/files/ptr/

    Why I am proposing it to comp.std.c++?  Because only the compiler can
determine if the classes are polymorphic or not and could instanciate the
proper partly specialized ptr_base<> by itself.  reinterpret_cast<>s will
still be possible because sizeof(ptr_base<T, simple_tree>) ==
sizeof(ptr_base<T, complex_tree>) and the allocated pointee uses the same
header; only get_count() & reset() members differ.



Regards,

Philippe A. Bouchard



---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: "Philippe A. Bouchard" <philippeb@videotron.ca>
Date: Fri, 30 Aug 2002 07:19:55 CST
Raw View
Hi,

    I would like to propose ptr.hpp as a global smart pointer:
http://groups.yahoo.com/group/boost/files/ptr/

    Why I am proposing it to comp.std.c++?  Because only the compiler can
determine if the classes are polymorphic or not and could instanciate the
proper partly specialized ptr_base<> by itself.  reinterpret_cast<>s will
still be possible because sizeof(ptr_base<T, simple_tree>) ==
sizeof(ptr_base<T, complex_tree>) and the allocated pointee uses the same
header; only get_count(), reset() & ~ptr() members differ.

    What do you think?



Regards,

Philippe A. Bouchard

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]