Boost logo

Boost :

From: Thomas Matelich (sosedada_at_[hidden])
Date: 2000-08-30 12:45:43


I'll just reply to myself to try and clear some things up.

template <typename PluginBase>
class SOMEObject: public boost::shared_ptr<PluginBase>
{
public:
    SOMEObject(const SOMEClassInfo&); //contains info on constructing the
plugin class
#ifdef BOOST_NO_MEMBER_TEMPLATES
    SOMEObject(const SOMEObject<SOMEUnknownBase>&); //frequently used base
class
#else
    template <typename Other>
    SOMEObject(const SOMEObject<Other>&);
#endif

    bool construct();

    //this works, should I put a BOOST_MSVC6_MEMBER_TEMPLATES here?
    template <typename Param1>
    bool construct(Param1&);
    //more construct funcs
};

I'm doing my main development work on MSVC, though this will need to be
*n*x portable. I changed the destructor for shared_ptr to virtual already
and things were going fine till I tried to build one with
SOMEObject<SOMEUnknownBase>. I had forgotten about sharing ownership.
Since I can't use shared_ptr's template constructor, I need access to
shared_ptr::share directly (and pn too, I've discovered). Hence my post.

I have no problem changing the name and making my own class (with
copyright of course), but I thought I'd see what your position was on
this.

Also, where can I find Valentin's patches to use dynamic_cast? Right now,
I'm casting then share-ing if!=NULL.

Now, if it were changed to allow specification of a newer and a deleter,
all I would have to do it write the newer, interesting.

Thanks.

--
Thomas O Matelich
Senior Software Designer
Zetec, Inc.
sosedada_at_[hidden]
tmatelich_at_[hidden]

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