namespace optional_detail {
-struct optional_tag {} ;
+struct init_value_tag {};
+
+struct optional_tag {};
template<class T>
// Creates an optional<T> initialized with 'val'.
// Can throw if T::T(T const&) does
- optional_base ( argument_type val )
+ optional_base ( init_value_tag, argument_type val )
:
m_initialized(false)
{
#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
// move-construct an optional<T> initialized from an rvalue-ref to 'val'.
// Can throw if T::T(T&&) does
- optional_base ( rval_reference_type val )
+ optional_base ( init_value_tag, rval_reference_type val )
:
m_initialized(false)
{
public :
- // **DEPPRECATED** Destroys the current value, if any, leaving this UNINITIALIZED
+ // Destroys the current value, if any, leaving this UNINITIALIZED
// No-throw (assuming T::~T() doesn't)
void reset() BOOST_NOEXCEPT { destroy(); }
// Creates an optional<T> initialized with 'val'.
// Can throw if T::T(T const&) does
- optional ( argument_type val ) : base(val) {}
+ optional ( argument_type val ) : base(optional_detail::init_value_tag(), val) {}
#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
// Creates an optional<T> initialized with 'move(val)'.
// Can throw if T::T(T &&) does
- optional ( rval_reference_type val ) : base( boost::forward<T>(val) )
+ optional ( rval_reference_type val ) : base(optional_detail::init_value_tag(), boost::forward<T>(val))
{}
#endif