
31 Mar
2009
31 Mar
'09
4:42 p.m.
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; }