mirror of
https://github.com/boostorg/optional.git
synced 2025-07-23 17:17:17 +02:00
Compare commits
1 Commits
svn-branch
...
boost-1.33
Author | SHA1 | Date | |
---|---|---|---|
3bb4d33db0 |
@ -29,8 +29,6 @@
|
||||
#include "boost/none_t.hpp"
|
||||
#include "boost/utility/compare_pointees.hpp"
|
||||
|
||||
#include "boost/optional/optional_fwd.hpp"
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
// VC6.0 has the following bug:
|
||||
// When a templated assignment operator exist, an implicit conversion
|
||||
@ -225,23 +223,6 @@ class optional_base : public optional_tag
|
||||
}
|
||||
}
|
||||
|
||||
// Assigns from another _convertible_ optional<U> (deep-copies the rhs value)
|
||||
template<class U>
|
||||
void assign ( optional<U> const& rhs )
|
||||
{
|
||||
if (is_initialized())
|
||||
{
|
||||
if ( rhs.is_initialized() )
|
||||
assign_value(static_cast<value_type>(rhs.get()), is_reference_predicate() );
|
||||
else destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( rhs.is_initialized() )
|
||||
construct(static_cast<value_type>(rhs.get()));
|
||||
}
|
||||
}
|
||||
|
||||
// Assigns from a T (deep-copies the rhs value)
|
||||
void assign ( argument_type val )
|
||||
{
|
||||
@ -500,7 +481,6 @@ class optional : public optional_detail::optional_base<T>
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef BOOST_OPTIONAL_NO_CONVERTING_ASSIGNMENT
|
||||
// Assigns from another convertible optional<U> (converts && deep-copies the rhs value)
|
||||
// Requires a valid conversion from U to T.
|
||||
@ -508,7 +488,7 @@ class optional : public optional_detail::optional_base<T>
|
||||
template<class U>
|
||||
optional& operator= ( optional<U> const& rhs )
|
||||
{
|
||||
this->assign(rhs);
|
||||
this->assign(rhs.get());
|
||||
return *this ;
|
||||
}
|
||||
#endif
|
||||
@ -763,11 +743,6 @@ template<class T> inline void swap ( optional<T>& x, optional<T>& y )
|
||||
optional_detail::optional_swap(x,y);
|
||||
}
|
||||
|
||||
template<class T> inline optional<T> make_optional ( T const& v )
|
||||
{
|
||||
return optional<T>(v);
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user