Boost logo

Boost :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2002-04-22 05:22:14


Hi,

I spend some more time on Loki style Policy based smart_ptr. I uploaded my
current approximation
here:
http://groups.yahoo.com/group/boost/files/Policy%20based%20smart_ptr/

It includes headers and test module I was using (tested on MSVC).
List of things I was lazy to add today:

1. ifdef template template parameters (do we need this?)
2. Did not address type of class hierarchy
3. ref_linked policy implementation
4. default template parameters.
5. Policies interconvertions

Here additional issues:

0. Note that version without template template parameters will not need type
T as a first parameter. You can access it though via value_type typedef.

1. Do we need to support compilers without member templates? I found that
some policies better to implement with them. If we do need this support, we
probably could provide version without member templates in separate file.
MSVC seems to have a bug with template copy constructor and assignment. But
I remember it was discussed and I hope to find a workaround.

2. Why do we need non const template copy constructor and assignment
operator?

3. Could we find convincing argument why do we need by_ref as a part of
smart_ptr interface? BTW boost have ref class with the same semantic.

4. equality comparison operators.
   a. Could we implement non-templates equality operators as free functions
(not a friends)? They implemented through other public functions.
   b. Why these operators trying to compare with const T* while it should be
pointer_type.
   c. For the same reasons templated comparison operators should have U rhs
not U const* rhs. But they immediately become too greedy and cause
ambiguity. Do not know yet what to do.

5. std::less should be specialized on pointer_type not T* in the
implementation of std::less specialization for smart_ptr

6. Need a hook for custom allocator in nonintrusive_ref_counted ownership
policy.

7. com_ref does not belong to generic header. Need some kind of generic
intrusive_ref_counted.

8. Comment to my previous comment: I found unreasonable to separate checkers
implementation.

9. Do we need std::swap specialization?

10 Do we need templated reset?

Regards,

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk