[Trilinos-Users] create RCP for member of an RCP-owned class

Holger Brandsmeier holger.brandsmeier at sam.math.ethz.ch
Fri Oct 14 12:37:00 MDT 2011


Dear list,

given a class A, that is owned by an RCP, say by a variable a of type
RCP<A>. A has a member `list` of type Teuchos::Array<T>. Now I want to
generate an RCP< Teuchos::Array<T> > where the deallocator is tied to
the RCP of the object. This will ensure that A is only deleted when
the use counts for both RCPs reach zero.

Which is the recommended way of doing this? Do I need to write my own
deallocated class for this, or is there already something existing
inside Teuchos?

Thanks,
Holger



More information about the Trilinos-Users mailing list