All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TfAnyUniquePtr Class Reference

A simple type-erased container that provides only destruction, moves and immutable, untyped access to the held value. More...

Public Member Functions

 TfAnyUniquePtr (TfAnyUniquePtr &&other)
 
TfAnyUniquePtroperator= (TfAnyUniquePtr &&other)
 
 TfAnyUniquePtr (TfAnyUniquePtr const &)=delete
 
TfAnyUniquePtroperator= (TfAnyUniquePtr const &)=delete
 
void const * Get () const
 Return a pointer to the owned object. More...
 

Static Public Member Functions

template<typename T >
static TfAnyUniquePtr New ()
 
template<typename T >
static TfAnyUniquePtr New (T const &v)
 

Detailed Description

A simple type-erased container that provides only destruction, moves and immutable, untyped access to the held value.

There are a couple of facilities that provide fallback or default values in error cases. TfAnyUniquePtr exists to hold these oft-instantiated but rarely accessed values. As such, its design prioritizes compile-time overhead over runtime performance and avoids clever metaprogramming. Please resist the urge to add functionality to this class (e.g. small object optimization, boost::python interoperability.)

Definition at line 43 of file anyUniquePtr.h.

Member Function Documentation

void const* Get ( ) const
inline

Return a pointer to the owned object.

Definition at line 86 of file anyUniquePtr.h.


The documentation for this class was generated from the following file: