[/
    Boost.Optional

    Copyright (c) 2003-2007 Fernando Luis Cacciola Carballal

    Distributed under the Boost Software License, Version 1.0.
    (See accompanying file LICENSE_1_0.txt or copy at
    http://www.boost.org/LICENSE_1_0.txt)
]


[#ref_header_optional_optional_hpp][section:header_optional_optional Synopsis]

    ```// In Header: <`[@boost:/boost/optional/optional.hpp boost/optional/optional.hpp]'''<phrase role="comment">&gt;</phrase>'''``

    namespace boost {

    template <class T>
    class optional
    {
    public :

        typedef T value_type;
        
        // (If T is of reference type, the parameters and results by reference are by value)

        optional () noexcept ; ``[link reference_optional_constructor __GO_TO__]``

        optional ( none_t ) noexcept ; ``[link reference_optional_constructor_none_t __GO_TO__]``

        optional ( T const& v ) ; ``[link reference_optional_constructor_value __GO_TO__]``
        
        optional ( T&& v ) ; ``[link reference_optional_constructor_move_value __GO_TO__]``

        // [new in 1.34]
        optional ( bool condition, T const& v ) ; ``[link reference_optional_constructor_bool_value __GO_TO__]`` 

        optional ( optional const& rhs ) ; ``[link reference_optional_constructor_optional __GO_TO__]``
        
        optional ( optional&& rhs ) noexcept(``['see below]``) ; ``[link reference_optional_move_constructor_optional __GO_TO__]``

        template<class U> explicit optional ( optional<U> const& rhs ) ; ``[link reference_optional_constructor_other_optional __GO_TO__]``
        
        template<class U> explicit optional ( optional<U>&& rhs ) ; ``[link reference_optional_move_constructor_other_optional __GO_TO__]``

        template<class InPlaceFactory> explicit optional ( InPlaceFactory const& f ) ; ``[link reference_optional_constructor_factory __GO_TO__]``

        template<class TypedInPlaceFactory> explicit optional ( TypedInPlaceFactory const& f ) ; ``[link reference_optional_constructor_factory __GO_TO__]``

        optional& operator = ( none_t ) noexcept ; ``[link reference_optional_operator_equal_none_t __GO_TO__]``

        optional& operator = ( T const& v ) ; ``[link reference_optional_operator_equal_value __GO_TO__]``
        
        optional& operator = ( T&& v ) ; ``[link reference_optional_operator_move_equal_value __GO_TO__]``

        optional& operator = ( optional const& rhs ) ; ``[link reference_optional_operator_equal_optional __GO_TO__]``
        
        optional& operator = ( optional&& rhs ) noexcept(``['see below]``) ; ``[link reference_optional_operator_move_equal_optional __GO_TO__]``

        template<class U> optional& operator = ( optional<U> const& rhs ) ; ``[link reference_optional_operator_equal_other_optional __GO_TO__]``
        
        template<class U> optional& operator = ( optional<U>&& rhs ) ; ``[link reference_optional_operator_move_equal_other_optional __GO_TO__]``
        
        template<class... Args> void emplace ( Args...&& args ) ; ``[link reference_optional_emplace __GO_TO__]``

        template<class InPlaceFactory> optional& operator = ( InPlaceFactory const& f ) ; ``[link reference_optional_operator_equal_factory __GO_TO__]``

        template<class TypedInPlaceFactory> optional& operator = ( TypedInPlaceFactory const& f ) ; ``[link reference_optional_operator_equal_factory __GO_TO__]``

        T const& get() const ; ``[link reference_optional_get __GO_TO__]``
        T&       get() ; ``[link reference_optional_get __GO_TO__]``

        T const* operator ->() const ; ``[link reference_optional_operator_arrow __GO_TO__]``
        T*       operator ->() ; ``[link reference_optional_operator_arrow __GO_TO__]``

        T const& operator *() const& ; ``[link reference_optional_operator_asterisk __GO_TO__]``
        T&       operator *() & ; ``[link reference_optional_operator_asterisk __GO_TO__]``
        T&&      operator *() && ; ``[link reference_optional_operator_asterisk_move __GO_TO__]``
        
        T const& value() const& ; ``[link reference_optional_value __GO_TO__]``
        T&       value() & ; ``[link reference_optional_value __GO_TO__]``
        T&&      value() && ; ``[link reference_optional_value_move __GO_TO__]``
        
        template<class U> T value_or( U && v ) const& ; ``[link reference_optional_value_or __GO_TO__]``
        template<class U> T value_or( U && v ) && ; ``[link reference_optional_value_or_move __GO_TO__]``
        
        template<class F> T value_or_eval( F f ) const& ; ``[link reference_optional_value_or_call __GO_TO__]``
        template<class F> T value_or_eval( F f ) && ; ``[link reference_optional_value_or_call_move __GO_TO__]``

        T const* get_ptr() const ; ``[link reference_optional_get_ptr __GO_TO__]``
        T*       get_ptr() ; ``[link reference_optional_get_ptr __GO_TO__]``

        explicit operator bool() const noexcept ; ``[link reference_optional_operator_bool __GO_TO__]``

        bool operator!() const noexcept ; ``[link reference_optional_operator_not __GO_TO__]``

        // deprecated methods

        // (deprecated)
        void reset() noexcept ; ``[link reference_optional_reset __GO_TO__]``

        // (deprecated)
        void reset ( T const& ) ; ``[link reference_optional_reset_value __GO_TO__]``

        // (deprecated)
        bool is_initialized() const ; ``[link reference_optional_is_initialized __GO_TO__]``

        // (deprecated)
        T const& get_value_or( T const& default ) const ; ``[link reference_optional_get_value_or_value __GO_TO__]`` 
    };

    template<class T> inline bool operator == ( optional<T> const& x, optional<T> const& y ) ; ``[link reference_operator_compare_equal_optional_optional __GO_TO__]``

    template<class T> inline bool operator != ( optional<T> const& x, optional<T> const& y ) ; ``[link reference_operator_compare_not_equal_optional_optional __GO_TO__]``

    template<class T> inline bool operator <  ( optional<T> const& x, optional<T> const& y ) ; ``[link reference_operator_compare_less_optional_optional __GO_TO__]``

    template<class T> inline bool operator >  ( optional<T> const& x, optional<T> const& y ) ; ``[link reference_operator_compare_greater_optional_optional __GO_TO__]``

    template<class T> inline bool operator <= ( optional<T> const& x, optional<T> const& y ) ; ``[link reference_operator_compare_less_or_equal_optional_optional __GO_TO__]``

    template<class T> inline bool operator >= ( optional<T> const& x, optional<T> const& y ) ; ``[link reference_operator_compare_greater_or_equal_optional_optional __GO_TO__]``
    
    template<class T> inline bool operator == ( optional<T> const& x, none_t ) noexcept ; ``[link reference_operator_compare_equal_optional_none __GO_TO__]``

    template<class T> inline bool operator != ( optional<T> const& x, none_t ) noexcept ; ``[link reference_operator_compare_not_equal_optional_none __GO_TO__]``

    template<class T> inline optional<T> make_optional ( T const& v ) ; ``[link reference_make_optional_value __GO_TO__]``

    template<class T> inline optional<T> make_optional ( bool condition, T const& v ) ; ``[link reference_make_optional_bool_value __GO_TO__]``

    template<class T> inline T const& get_optional_value_or ( optional<T> const& opt, T const& default ) ; ``[link reference_optional_get_value_or_value __GO_TO__]`` 

    template<class T> inline T const& get ( optional<T> const& opt ) ; ``[link reference_optional_get __GO_TO__]``

    template<class T> inline T& get ( optional<T> & opt ) ; ``[link reference_optional_get __GO_TO__]``

    template<class T> inline T const* get ( optional<T> const* opt ) ; ``[link reference_optional_get __GO_TO__]``

    template<class T> inline T* get ( optional<T>* opt ) ; ``[link reference_optional_get __GO_TO__]``

    template<class T> inline T const* get_pointer ( optional<T> const& opt ) ; ``[link reference_optional_get_ptr __GO_TO__]``

    template<class T> inline T* get_pointer ( optional<T> & opt ) ; ``[link reference_optional_get_ptr __GO_TO__]``

    template<class T> inline void swap( optional<T>& x, optional<T>& y ) ; ``[link reference_swap_optional_optional __GO_TO__]``

    } // namespace boost


[endsect]
