Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

詳細語義

因為 T 可能是引用類型,所以,那些語義與 T 的類型是否為引用相關的項,將使用以下約定:

[Note] 說明

以下章節中包含多個 assert(),僅用於示範後續條件的例子代碼。它 並不意味著類型 T 必須支持每個單獨的表達式,但是如果它支持某個表達式,則滿足相應的條件。

space

optional 類的成員函數

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