forked from boostorg/optional
corrected the compiler workarounds
This commit is contained in:
@ -104,9 +104,9 @@
|
||||
#endif
|
||||
|
||||
#if defined __SUNPRO_CC
|
||||
# define BOOST_OPTIONAL_DETAIL_USE_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
#elif (defined _MSC_FULL_VER) && (_MSC_FULL_VER < 190023026)
|
||||
# define BOOST_OPTIONAL_DETAIL_USE_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
#endif
|
||||
|
||||
#endif // header guard
|
||||
|
@ -817,7 +817,7 @@ class optional : public optional_detail::optional_base<T>
|
||||
// Can throw if T::T(U const&) does
|
||||
template<class U>
|
||||
explicit optional ( optional<U> const& rhs
|
||||
#ifdef BOOST_OPTIONAL_DETAIL_USE_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
,typename boost::enable_if< optional_detail::is_optional_constructible<T, U const&> >::type* = 0
|
||||
#endif
|
||||
)
|
||||
@ -834,7 +834,7 @@ class optional : public optional_detail::optional_base<T>
|
||||
// Can throw if T::T(U&&) does
|
||||
template<class U>
|
||||
explicit optional ( optional<U> && rhs
|
||||
#ifdef BOOST_OPTIONAL_DETAIL_USE_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
,typename boost::enable_if< optional_detail::is_optional_constructible<T, U> >::type* = 0
|
||||
#endif
|
||||
)
|
||||
|
@ -41,9 +41,11 @@ struct superconv
|
||||
|
||||
void test_optional_of_superconverting_T() // compile-time test
|
||||
{
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT
|
||||
superconv<optional<int> > s;
|
||||
superconv<optional<int> > & rs = s;
|
||||
optional<superconv<optional<int> > > os = rs;
|
||||
#endif
|
||||
}
|
||||
|
||||
void test_optional_optional_T()
|
||||
|
@ -33,7 +33,7 @@ BOOST_STATIC_ASSERT(( !boost::is_constructible<Resource, const Y&>::value ));
|
||||
BOOST_STATIC_ASSERT(( boost::is_constructible<optional<Resource>, const X&>::value ));
|
||||
BOOST_STATIC_ASSERT(( !boost::is_constructible<optional<Resource>, const Y&>::value ));
|
||||
|
||||
#ifdef BOOST_OPTIONAL_DETAIL_USE_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||
BOOST_STATIC_ASSERT(( boost::is_constructible< optional< optional<int> >, optional<int> >::value ));
|
||||
BOOST_STATIC_ASSERT(( !boost::is_constructible< optional<int>, optional< optional<int> > >::value ));
|
||||
|
||||
|
Reference in New Issue
Block a user