All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
hext::Cloneable< Derived, Base > Class Template Reference

Curiously recurring template pattern that extends a base class to provide a virtual method Cloneable::clone(). More...

Inheritance diagram for hext::Cloneable< Derived, Base >:
Inheritance graph
[legend]
Collaboration diagram for hext::Cloneable< Derived, Base >:
Collaboration graph
[legend]

Public Member Functions

virtual std::unique_ptr< Base > clone () const
 Clones objects of template type Derived and returns an owning pointer to the newly allocated Base. More...
 

Detailed Description

template<typename Derived, typename Base>
class hext::Cloneable< Derived, Base >

Curiously recurring template pattern that extends a base class to provide a virtual method Cloneable::clone().

Template Parameters
DerivedA subclass of Cloneable that is copy constructible.
BaseThe base class that shall be extended.

Definition at line 34 of file Cloneable.h.

Member Function Documentation

template<typename Derived, typename Base>
virtual std::unique_ptr<Base> hext::Cloneable< Derived, Base >::clone ( ) const
inlinevirtual

Clones objects of template type Derived and returns an owning pointer to the newly allocated Base.

Fails at compile time if template parameter Base is not a base of template parameter Derived or if template parameter Derived is not copy constructible.

Definition at line 43 of file Cloneable.h.


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