Bond
 
Loading...
Searching...
No Matches
bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type > Class Template Reference

Nullable type. More...

Inheritance diagram for bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >:
bond::detail::allocator_holder< detail::allocator_type< T >::type >

Public Member Functions

 nullable () BOND_NOEXCEPT_IF(std
 Default constructor. More...
 
 nullable (const allocator_type &alloc)
 Construct nullable using specified allocator instance. More...
 
 nullable (const nullable &other)
 Copy constructor. More...
 
 nullable (const T &value, const allocator_type &alloc={})
 Construct from an instance T. More...
 
nullableoperator= (const nullable &other)
 Assignment operator. More...
 
bool empty () const BOND_NOEXCEPT
 Checks if the object is null. More...
 
T & value () BOND_NOEXCEPT
 Return reference to contained value. More...
 
const T & value () const BOND_NOEXCEPT
 Return constant reference to contained value. More...
 
T & operator* () BOND_NOEXCEPT
 Dereference operator. More...
 
const T & operator* () const BOND_NOEXCEPT
 Dereference operator. More...
 
T & set ()
 Set to default instance of T and return reference to the value. More...
 
void set (const T &value)
 Set to specified value. More...
 
void reset ()
 Reset to null. More...
 
void clear ()
 The same as reset. More...
 

Detailed Description

template<typename T>
class bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >

Nullable type.

See User's Manual

Constructor & Destructor Documentation

◆ nullable() [1/4]

template<typename T >
bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::nullable ( )

Default constructor.

◆ nullable() [2/4]

template<typename T >
bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::nullable ( const allocator_type &  alloc)
explicit

Construct nullable using specified allocator instance.

◆ nullable() [3/4]

template<typename T >
bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::nullable ( const nullable< T, typename boost::disable_if< detail::use_value< T > >::type > &  other)

Copy constructor.

◆ nullable() [4/4]

template<typename T >
bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::nullable ( const T &  value,
const allocator_type &  alloc = {} 
)
explicit

Construct from an instance T.

Member Function Documentation

◆ clear()

template<typename T >
void bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::clear ( )

The same as reset.

◆ empty()

template<typename T >
bool bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::empty ( ) const

Checks if the object is null.

◆ operator*() [1/2]

template<typename T >
T & bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::operator* ( )

Dereference operator.

Undefined if the object is null

◆ operator*() [2/2]

template<typename T >
const T & bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::operator* ( ) const

Dereference operator.

Undefined if the object is null

◆ operator=()

template<typename T >
nullable & bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::operator= ( const nullable< T, typename boost::disable_if< detail::use_value< T > >::type > &  other)

Assignment operator.

◆ reset()

template<typename T >
void bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::reset ( )

Reset to null.

◆ set() [1/2]

template<typename T >
T & bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::set ( )

Set to default instance of T and return reference to the value.

◆ set() [2/2]

template<typename T >
void bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::set ( const T &  value)

Set to specified value.

◆ value() [1/2]

template<typename T >
T & bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::value ( )

Return reference to contained value.

Undefined if the object is null

◆ value() [2/2]

template<typename T >
const T & bond::nullable< T, typename boost::disable_if< detail::use_value< T > >::type >::value ( ) const

Return constant reference to contained value.

Undefined if the object is null