Boost logo

Boost :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2002-04-27 04:07:05


I made some changes to Loki style smart_ptr approximation that located here:

Here list of issues addressed:

1. I made generators for stl-like auto_ptr and auto_array
2. I made generators for boost-like scoped_ptr and scoped_array
3. I made generators for boost-like shared_ptr and shared_array
All generators look like this:

namespace boost {

template<class T>
struct scoped_ptr_generator



> type;

An alternative wouldbe to inherit from this types. I do not know what is
better yet. shared_ptr generator uses traits to automatically deduce type of
reference counting to use. I presume we could use 'has member' facility here
to add more automation.

4. I added intrusive_ref_counted ownership policy.
5. I redesigned checking policies. Now Checking policy specification would
look like this:
6. I added some interpolicies convertions (still some missing)
7. I added one more ownership policy
8. More tests added
9. I checked current smart_ptr_test.cpp using my generators. With exclusion
of missing operator[] all test are passing (well, 3 are failing but this is
because I have for smart_ptr<...> v => v.use_count() = 0, while current
implementation gives 1. Is there specific reason why is that? )
10. Since I did not find a solution for templated free function operator==
in general case I rollback to form where if defines comparisons with U
const*. At least it will work for pointers.

My test is passing on MSVC. Could somebody try to test on different

Any Comments?



Boost list run by bdawes at, gregod at, cpdaniel at, john at