Boost logo

Boost :

From: John Torjo (john.groups_at_[hidden])
Date: 2007-11-20 01:18:25


Assume you have this:

void some_func(shared_ptr<some_class> p);

some_class * ptr = ...;
some_func(ptr);

Would you really want an automatic conversion of ptr to
shared_ptr<some_class> ?

Best,
John
> template<class T> class shared_ptr
> {
> template<class Y>
> explicit shared_ptr( Y * p ): px( p ), pn( p ) // Y must be complete
> {
> detail::sp_enable_shared_from_this( pn, p, p );
> }
> };
>

-- 
http://John.Torjo.com -- C++ expert
... call me only if you want things done right

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