Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Detailed Semantics

Because T might be of reference type, in the sequel, those entries whose semantic depends on T being of reference type or not will be distinguished using the following convention:

[Note] Note

The following section contains various assert() which are used only to show the postconditions as sample code. It is not implied that the type T must support each particular expression but that if the expression is supported, the implied condition holds.

space

optional class member functions

space

optional<T>::optional();

space

optional<T>::optional( none_t );

space

optional<T (not a ref)>::optional( T const& v )

space

optional<T&>::optional( T& ref )

space

optional<T (not a ref)>::optional( bool condition, T const& v ) ;

optional<T&> ::optional( bool condition, T& v ) ;

optional<T (not a ref)>::optional( T const& v )

optional<T&> ::optional( T& v )

optional<T ['(not a ref)]>::optional()

optional<T&> ::optional()

space

optional<T (not a ref)>::optional( optional const& rhs );

space

optional<T&>::optional( optional const& rhs );

space

template<U> explicit optional<T (not a ref)>::optional( optional<U> const& rhs );

space

template<InPlaceFactory> explicit optional<T (not a ref)>::optional( InPlaceFactory const& f );

template<TypedInPlaceFactory> explicit optional<T (not a ref)>::optional( TypedInPlaceFactory const& f );

space

optional& optional<T (not a ref)>::operator= ( T const& rhs ) ;

space

optional<T&>& optional<T&>::operator= ( T& const& rhs ) ;

space

optional& optional<T (not a ref)>::operator= ( optional const& rhs ) ;

space

optional<T&> & optional<T&>::operator= ( optional<T&> const& rhs ) ;

space

template<U> optional& optional<T (not a ref)>::operator= ( optional<U> const& rhs ) ;

space

void optional<T (not a ref)>::reset( T const& v ) ;

space

void optional<T>::reset() ;

space

T const& optional<T (not a ref)>::operator*() const ;

T& optional<T (not a ref)>::operator*();

T const& optional<T (not a ref)>::get() const ;

T& optional<T (not a ref)>::get() ;

inline T const& get ( optional<T (not a ref)> const& ) ;

inline T& get ( optional<T (not a ref)> &) ;

space

T const& optional<T (not a ref)>::get_value_or( T const& default) const ;

T& optional<T (not a ref)>::get_value_or( T& default ) ;

inline T const& get_optional_value_or ( optional<T (not a ref)> const& o, T const& default ) ;

inline T& get_optional_value_or ( optional<T (not a ref)>& o, T& default ) ;

space

T const& optional<T&>::operator*() const ;

T & optional<T&>::operator*();

T const& optional<T&>::get() const ;

T& optional<T&>::get() ;

inline T const& get ( optional<T&> const& ) ;

inline T& get ( optional<T&> &) ;

space

T const* optional<T (not a ref)>::get_ptr() const ;

T* optional<T (not a ref)>::get_ptr() ;

inline T const* get_pointer ( optional<T (not a ref)> const& ) ;

inline T* get_pointer ( optional<T (not a ref)> &) ;

space

T const* optional<T (not a ref)>::operator ->() const ;

T* optional<T (not a ref)>::operator ->() ;

space

optional<T>::operator unspecified-bool-type() const ;

space

bool optional<T>::operator!() ;

space

bool optional<T>::is_initialized() const ;

space

Free functions

space

optional<T (not a ref)> make_optional( T const& v )

space

optional<T (not a ref)> make_optional( bool condition, T const& v )

space

bool operator == ( optional<T> const& x, optional<T> const& y );

space

bool operator < ( optional<T> const& x, optional<T> const& y );

space

bool operator != ( optional<T> const& x, optional<T> const& y );

space

bool operator > ( optional<T> const& x, optional<T> const& y );

space

bool operator <= ( optional<T> const& x, optional<T> const& y );

space

bool operator >= ( optional<T> const& x, optional<T> const& y );

space

void swap ( optional<T>& x, optional<T>& y );


PrevUpHomeNext