libfilezilla
Public Member Functions | List of all members
sparse_optional< T > Class Template Referencefinal

Similar to C++17's std::optional, but stores the data in dynamic memory. More...

#include <optional.hpp>

Public Member Functions

 sparse_optional (T const &v)
 
 sparse_optional (T *v) noexcept
 Takes ownership of pointer.
 
 sparse_optional (sparse_optional< T > const &v)
 
 sparse_optional (sparse_optional< T > &&v) noexcept
 
void clear ()
 
 operator bool () const
 
T & operator* ()
 
T const & operator* () const
 
T * operator-> ()
 
T const * operator-> () const
 
bool operator== (sparse_optional< T > const &cmp) const
 
bool operator!= (sparse_optional< T > const &cmp) const
 
bool operator< (sparse_optional< T > const &cmp) const
 
sparse_optional< T > & operator= (sparse_optional< T > const &v)
 
sparse_optional< T > & operator= (sparse_optional< T > &&v) noexcept
 

Detailed Description

template<typename T>
class fz::sparse_optional< T >

Similar to C++17's std::optional, but stores the data in dynamic memory.

sparse_optional is useful to save memory if it is expected that the object is rarely set and the object's size is bigger than a simple pointer.


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