Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
Conversion utilities for going between Teuchos::RCP and std::shared_ptr.

Classes

class  Teuchos::DeallocStdSharedPtr< T >
 Teuchos::RCP Deallocator class that wraps a std::shared_ptr More...
 
class  Teuchos::StdSharedPtrRCPDeleter< T >
 std::shared_ptr deleter class that wraps a Teuchos::RCP. More...
 

Functions

template<class T >
bool Teuchos::is_null (const std::shared_ptr< T > &p)
 Returns true if p.get()==NULL. More...
 
template<class T >
bool Teuchos::nonnull (const std::shared_ptr< T > &p)
 Returns true if p.get()!=NULL. More...
 

Detailed Description

The smart pointer classes Teuchos::RCP and std::shared_ptr are easily compatible. The two templated conversion functions Teuchos::rcp( const std::shared_ptr<T> & ) and Teuchos::get_shared_ptr( const RCP<T> & ) have been created for converting back and forth (see the related non-member functions rcp() and get_shared_ptr() the RCP classes' documentation).

Function Documentation

template<class T >
bool Teuchos::is_null ( const std::shared_ptr< T > &  p)
inline

Returns true if p.get()==NULL.

Examples:
test/MemoryManagement/RCP_test.cpp.

Definition at line 116 of file Teuchos_RCPStdSharedPtrConversionsDecl.hpp.

template<class T >
bool Teuchos::nonnull ( const std::shared_ptr< T > &  p)
inline

Returns true if p.get()!=NULL.

Definition at line 127 of file Teuchos_RCPStdSharedPtrConversionsDecl.hpp.