Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::base::Lazy< T > Class Template Reference

Lazily populates a value. More...

#include "once.h"

Public Member Functions

 Lazy (const std::function< T()> &creator)
 
 Lazy (const Lazy< T > &other)
 Copy constructor, only copies the creator. More...
 
const TGet () const
 

Detailed Description

template<typename T>
class ion::base::Lazy< T >

Lazily populates a value.

Supports copy construct for use in resizable containers. Note that the creator function will be called once for each copy even if the value has been evaluated, so container resizing should be avoided once values have started to be populated.

Definition at line 65 of file once.h.

Constructor & Destructor Documentation

template<typename T>
ion::base::Lazy< T >::Lazy ( const std::function< T()> &  creator)
inlineexplicit

Definition at line 67 of file once.h.

template<typename T>
ion::base::Lazy< T >::Lazy ( const Lazy< T > &  other)
inline

Copy constructor, only copies the creator.

Definition at line 70 of file once.h.

Member Function Documentation

template<typename T>
const T& ion::base::Lazy< T >::Get ( ) const
inline

Definition at line 71 of file once.h.

References ion::base::OnceFlag::CallOnce().


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