$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Cyclic includes when using smart pointers.
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-03-31 12:42:43
Jared Lee Richardson:
> Oh ok, now I feel dumb. :(
>
> I thought that because it was a template, I couldn't forward declare it
> because the template would need information about the class.
No need to feel dumb; most smart pointers do not support this use, but
shared_ptr does. You can even do things like
class X;
shared_ptr<X> f( bool b, shared_ptr<X> p, shared_ptr<X> q )
{
return b? p: q;
}