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 {};
using namespace Teuchos;
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;
}