3.2.2
Freundlich's C++ toolkit
Public Member Functions
fcppt::recursive< Type > Class Template Reference

Detailed Description

template<typename Type>
class fcppt::recursive< Type >

Turns an incomplete type into a complete one, allowing recursion.

Unfortunately, C++ makes no guarantees that incomplete types can be used as a template parameter of a container like std::vector. For example, the following might or might not work:

struct X { std::vector<X> x; };

The recursive class uses a unique pointer internally which allows its type to be incomplete. We can therefore write

struct X { std::vector<fcppt::recursive<X>> x; };

Public Member Functions

 recursive (Type const &)
 
 recursive (Type &&)
 
 recursive (recursive const &)
 
 recursive (recursive &&) noexcept
 
recursiveoperator= (recursive const &)
 
recursiveoperator= (recursive &&) noexcept
 
 ~recursive ()
 
Type & get ()
 
Type const & get () const
 

Constructor & Destructor Documentation

◆ recursive() [1/4]

template<typename Type >
fcppt::recursive< Type >::recursive ( Type const &  )
explicit

◆ recursive() [2/4]

template<typename Type >
fcppt::recursive< Type >::recursive ( Type &&  )
explicit

◆ recursive() [3/4]

template<typename Type >
fcppt::recursive< Type >::recursive ( recursive< Type > const &  )

◆ recursive() [4/4]

template<typename Type >
fcppt::recursive< Type >::recursive ( recursive< Type > &&  )
noexcept

◆ ~recursive()

template<typename Type >
fcppt::recursive< Type >::~recursive ( )

Member Function Documentation

◆ get() [1/2]

template<typename Type >
Type& fcppt::recursive< Type >::get ( )

◆ get() [2/2]

template<typename Type >
Type const& fcppt::recursive< Type >::get ( ) const

◆ operator=() [1/2]

template<typename Type >
recursive& fcppt::recursive< Type >::operator= ( recursive< Type > const &  )

◆ operator=() [2/2]

template<typename Type >
recursive& fcppt::recursive< Type >::operator= ( recursive< Type > &&  )
noexcept