diff --git a/include/boost/optional/detail/optional_config.hpp b/include/boost/optional/detail/optional_config.hpp index 5c388fb..42aeda0 100644 --- a/include/boost/optional/detail/optional_config.hpp +++ b/include/boost/optional/detail/optional_config.hpp @@ -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 diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index e450898..a465b9e 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -817,7 +817,7 @@ class optional : public optional_detail::optional_base // Can throw if T::T(U const&) does template explicit optional ( optional 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 >::type* = 0 #endif ) @@ -834,7 +834,7 @@ class optional : public optional_detail::optional_base // Can throw if T::T(U&&) does template explicit optional ( optional && 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 >::type* = 0 #endif ) diff --git a/test/optional_test_convert_from_T.cpp b/test/optional_test_convert_from_T.cpp index 2abe7e5..6d4c2ff 100644 --- a/test/optional_test_convert_from_T.cpp +++ b/test/optional_test_convert_from_T.cpp @@ -41,9 +41,11 @@ struct superconv void test_optional_of_superconverting_T() // compile-time test { +#ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT superconv > s; superconv > & rs = s; optional > > os = rs; +#endif } void test_optional_optional_T() diff --git a/test/optional_test_sfinae_friendly_ctor.cpp b/test/optional_test_sfinae_friendly_ctor.cpp index 3fefc0e..87539e1 100644 --- a/test/optional_test_sfinae_friendly_ctor.cpp +++ b/test/optional_test_sfinae_friendly_ctor.cpp @@ -33,7 +33,7 @@ BOOST_STATIC_ASSERT(( !boost::is_constructible::value )); BOOST_STATIC_ASSERT(( boost::is_constructible, const X&>::value )); BOOST_STATIC_ASSERT(( !boost::is_constructible, 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 >, optional >::value )); BOOST_STATIC_ASSERT(( !boost::is_constructible< optional, optional< optional > >::value ));