This is an example of how to use the Teuchos::RCP
class.
#include "Teuchos_Version.hpp"
class A {
public:
A() {}
virtual ~A(){}
virtual void f(){}
};
class B1 : virtual public A {};
class B2 : virtual public A {};
class C : public B1, public B2 {};
int main(int argc, char* argv[])
{
std::cout << Teuchos::Teuchos_Version() << std::endl << std::endl;
RCP<B2> nc_b2_ptr = rcp_const_cast<B2>(b2_ptr);
A *ra_ptr2 = new A,
*ra_ptr3 = new A;
a_ptr3 = a_ptr1;
a_ptr2->f();
ra_ptr2->f();
*a_ptr2 = *a_ptr3;
*ra_ptr2 = *ra_ptr3;
A* true_ptr = 0;
return 0;
}
Reference-counted pointer class and non-member templated function implementations.
Smart reference counting pointer class for automatic garbage collection.
T * get() const
Get the raw C++ pointer to the underlying object.
#define TEUCHOS_ASSERT_EQUALITY(val1, val2)
This macro is checks that to numbers are equal and if not then throws an exception with a good error ...
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.