Topic: Status of adding Policy Based Smart Pointer to the standard
Author: "Axter" <google@axter.com>
Date: Fri, 7 Oct 2005 21:12:36 CST Raw View
What is the status of adding Policy Based Smart Pointer to the
standard?
Is it still under consideration?
Is there specific example implementation that they're looking at?
---
[ 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: "Lance Diduck" <lancediduck@nyc.rr.com>
Date: Sat, 8 Oct 2005 22:28:35 CST Raw View
I don't know of any such proposal. There are a number of
implementations out there, notably Alexandrescu's. I hope to publicly
deploy one that meets the tr1 interface, where the different policy
versions pass the same tests that at least the boost implementation
does. This is different than just doing a typedef like typedef
basic_string<char,char_traits<char >, allocator<char> > string; But
there are ways to achieve it. For example
template<class shared_ptrT, class sharedptrA > >
class basic_shared_ptr{
//...
};
//the impl that meets the standard
template<class shared_ptrT>
struct shared_ptr:basic_shared_ptr<shared_ptrT,
detail::shared_count<std::allocator<void>
//a version boosted from boost, and allocatorized
>{
//constructors as necessary, plus other details
};
Another way is by a factory function, overloaded on T and D. That
worked, but was far harder to test and understand. I chunked it.
There are a number of non design challenges in making such a reference
version, least of all copyright, build testers, porting to a number of
platforms, etc. But however it is done, the implementation policy
properties would need some time to stabilize even before a proposal is
made. I do have prototypes in use at my day job, ported to Sun WS and
vacpp, and MSVC. These are in library format.
---
[ 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 ]