Boost C++ Libraries Home Libraries People FAQ More

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() noexcept;

space

optional<T>::optional( none_t ) noexcept;

space

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

space

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

space

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

space

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

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

optional<T (not a ref)>::optional( optional&& rhs ) noexcept(see below);

space

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

space

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

space

template<U> explicit optional<T (not a ref)>::optional( optional<U>&& 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>::operator= ( none_t ) noexcept;

space

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

space

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

space

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

space

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

space

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

space

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

space

optional& optional<T (not a ref)>::operator= ( optional&& rhs ) noexcept(see below);

space

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

space

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

space

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

space

template<class... Args> void optional<T (not a ref)>::emplace( Args...&& args );

space

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

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

space

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

space

void optional<T>::reset() noexcept ;

space

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&>::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)>::operator*() const& ;

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

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

space

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

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

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

space

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

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

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

template<class U> T optional<T>::value_or(U && v) const& ;

template<class U> T optional<T>::value_or(U && v) && ;

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 (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

explicit optional<T>::operator bool() const ;

space

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

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 );

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

space

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

space

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


PrevUpHomeNext