Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-04-18 17:11:10


"Andrei Alexandrescu" <andrewalex_at_[hidden]> wrote in message
news:DAV59VS8wEv0UxeBYz90000847b_at_hotmail.com...
> [...]
> Come on, Dave, why wouldn't you do that?

I'm not the Dave you were looking for, but I did Boostify Loki::SmartPtr
as much as I could, and have uploaded it to:
http://groups.yahoo.com/group/boost/files/smart_ptr.hpp

Basically, I removed dependencies from Loki, commenting out code
where necessary. Instead of using Loki::SmallObject, it just uses the
default allocator (until Loki::SmallObject gets ported, of course). I
replaced assert with BOOST_ASSERT, and CT_ASSERT with BOOST_STATIC_ASSERT
(though they work differently, and I
converted the class-error-message into a comment). I stole Select
right out of TypeManip, and just inserted where appropriate, because
I am not sure if Boost already has such a facility, or where it is.
Obviously, the usage of PTS will require a workaround for portability
from someone that knows how to do that. I suspect that MPL::select_if
does what I want, but that's not boost yet. ;)

I enclosed member templates with
#ifndef BOOST_NO_MEMBER_TEMPLATES, but offered no
alternative, since I'm not sure what can be done about those. Is it
possible to offer a non-nested template alternative? Other than that,
I just changed the case of the names to conform to Boost coding
guidelines, and made a few minor changes. I only compiled it on
gcc-3.0 on intel-686-linux-gnu. It didn't like NullPointerException,
so I tweaked that a bit. It also doesn't like:

template <class P, template <class> ThreadingModel>
class ref_count_mt : public ThreadingModel<ref_count_mt>

so I just commented out that policy for now, until someone can
produce a workaround. My test program was very small, and didn't
test the library much at all. The main goal was to provide a starting
point for someone with a little more experience. I just got most of the
grunt work out of the way, so there's little excuse to not make this thing
work. ;)

All right, now who's willing to pick up the ball?

Dave


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