Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Smart pointer a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 44049 of 48417
Post > Topic >>

Smart pointer and cyclic dependencies

by =?ISO-8859-1?Q?Marcel_M=FCller?= <news.5.maazl@[EMAIL PROTECTED] > Mar 21, 2008 at 05:42 PM

Hi,

I have the problem that two types have smart pointers that point on each 
other. The smart pointers are similar to boost::intrisive_ptr and 
boost::scoped_ptr, but not identical, because the the platform is too 
old for the boost libraries to compile. Unfortunately my implementations 
requires T to be a complete type.

The boost do***entation says the T need not to be a complete type unless 
you instantiate the smart pointer. How did they do the trick? I found no 
hint in the boost do***entation.


class B;

class A
{
   scoped_ptr<B> b;
   //...

};

class B
{
   intrusive_ptr<A> a;
   //...

};


Is there a solution for the above dependency other than turning b into 
an ordinary pointer and emulating the smart pointer in the functions of A?
 




 2 Posts in Topic:
Smart pointer and cyclic dependencies
=?ISO-8859-1?Q?Marcel_M=F  2008-03-21 17:42:10 
Re: Smart pointer and cyclic dependencies
=?ISO-8859-1?Q?Marcel_M=F  2008-03-22 11:39:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 9:39:15 CST 2008.