mirror of
https://github.com/boostorg/optional.git
synced 2026-07-06 16:40:53 +02:00
Add more robust constexpr support
This commit is contained in:
@@ -210,7 +210,7 @@ namespace boost {
|
||||
// Compile time tweaking on whether or not swap should use the default constructor:
|
||||
//
|
||||
|
||||
#ifndef BOOST_OPTIONAL_USES_CONSTEXPR_IMPLEMENTATION
|
||||
#ifndef BOOST_OPTIONAL_USES_UNION_IMPLEMENTATION
|
||||
template <> struct optional_swap_should_use_default_constructor<
|
||||
optional_swap_test::class_whose_default_ctor_should_be_used> : true_type {} ;
|
||||
|
||||
@@ -219,7 +219,7 @@ template <> struct optional_swap_should_use_default_constructor<
|
||||
|
||||
template <class T> struct optional_swap_should_use_default_constructor<
|
||||
optional_swap_test::template_whose_default_ctor_should_be_used<T> > : true_type {} ;
|
||||
#endif // BOOST_OPTIONAL_USES_CONSTEXPR_IMPLEMENTATION
|
||||
#endif // BOOST_OPTIONAL_USES_UNION_IMPLEMENTATION
|
||||
|
||||
//
|
||||
// Specialization of boost::swap:
|
||||
@@ -353,14 +353,14 @@ void test_swap_member_function( T const* )
|
||||
void test_swap_tweaking()
|
||||
{
|
||||
( test_swap_function( ARG(optional_swap_test::class_without_default_ctor) ) );
|
||||
#ifndef BOOST_OPTIONAL_USES_CONSTEXPR_IMPLEMENTATION
|
||||
#ifndef BOOST_OPTIONAL_USES_UNION_IMPLEMENTATION
|
||||
( test_swap_function( ARG(optional_swap_test::class_whose_explicit_ctor_should_be_used) ) );
|
||||
( test_swap_function( ARG(optional_swap_test::class_whose_default_ctor_should_be_used) ) );
|
||||
( test_swap_function( ARG(optional_swap_test::class_whose_default_ctor_should_not_be_used) ) );
|
||||
( test_swap_function( ARG(optional_swap_test::template_whose_default_ctor_should_be_used<char>) ) );
|
||||
#endif
|
||||
( test_swap_member_function( ARG(optional_swap_test::class_without_default_ctor) ) );
|
||||
#ifndef BOOST_OPTIONAL_USES_CONSTEXPR_IMPLEMENTATION
|
||||
#ifndef BOOST_OPTIONAL_USES_UNION_IMPLEMENTATION
|
||||
( test_swap_member_function( ARG(optional_swap_test::class_whose_explicit_ctor_should_be_used) ) );
|
||||
( test_swap_member_function( ARG(optional_swap_test::class_whose_default_ctor_should_be_used) ) );
|
||||
( test_swap_member_function( ARG(optional_swap_test::class_whose_default_ctor_should_not_be_used) ) );
|
||||
|
||||
Reference in New Issue
Block a user