DUECA/DUSIME
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
fix_optional< T > Class Template Reference

Make fixed-size objects optional, using a boolean flag for "null/nil/None" values. More...

#include <fix_optional.hxx>

Public Types

typedef T value_type
 Value objects type.
 

Public Member Functions

 fix_optional (const value_type &defval)
 constructor with default value for the data
 
 fix_optional ()
 constructor without default value for the data
 
 fix_optional (const fix_optional< T > &other)
 copy constructor; copies the data
 
template<typename D >
 fix_optional (const D &defval)
 copy constructor with a conversion to value
 
template<class InputIt >
 fix_optional (InputIt first, InputIt last)
 construct from iterators
 
fix_optional< T > & operator= (const fix_optional< T > &other)
 assignment operator
 
fix_optional< T > & operator= (const T &val)
 assignment operator, to value type
 
template<typename D >
fix_optional< T > & operator= (const D &val)
 Assignment operator, with conversion to value.
 
bool operator== (const fix_optional< T > &other) const
 equality test
 
bool operator!= (const fix_optional< T > &other) const
 inequality test
 

Public Attributes

bool valid
 Object is valid, filled, non-null.
 
value_type value
 Encapsulated value.
 

Static Public Attributes

static constexpr const char * classname = "fix_optional"
 Name.
 

Detailed Description

template<typename T>
class fix_optional< T >

Make fixed-size objects optional, using a boolean flag for "null/nil/None" values.

Template Parameters
TDatatype.

Constructor & Destructor Documentation

◆ fix_optional()

template<typename T >
fix_optional< T >::fix_optional ( const value_type & defval)
inline

constructor with default value for the data

Parameters
defvaldefault fill value

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