forked from boostorg/variant2
Merge branch 'develop' into feature/doc
This commit is contained in:
@ -27,10 +27,10 @@ run variant_default_construct.cpp ;
|
|||||||
compile variant_default_construct_cx.cpp ;
|
compile variant_default_construct_cx.cpp ;
|
||||||
|
|
||||||
run variant_copy_construct.cpp ;
|
run variant_copy_construct.cpp ;
|
||||||
compile variant_copy_construct_cx.cpp ;
|
compile variant_copy_construct_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
||||||
|
|
||||||
run variant_move_construct.cpp ;
|
run variant_move_construct.cpp ;
|
||||||
compile variant_move_construct_cx.cpp ;
|
compile variant_move_construct_cx.cpp : [ requires cxx14_constexpr ] ;
|
||||||
|
|
||||||
run variant_value_construct.cpp ;
|
run variant_value_construct.cpp ;
|
||||||
compile variant_value_construct_cx.cpp ;
|
compile variant_value_construct_cx.cpp ;
|
||||||
|
@ -6,13 +6,6 @@
|
|||||||
// See accompanying file LICENSE_1_0.txt or copy at
|
// See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#if !defined( __cpp_constexpr ) || __cpp_constexpr < 201603
|
|
||||||
|
|
||||||
// no constexpr lambda support
|
|
||||||
int main() {}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <boost/variant2/variant.hpp>
|
#include <boost/variant2/variant.hpp>
|
||||||
|
|
||||||
using namespace boost::variant2;
|
using namespace boost::variant2;
|
||||||
@ -40,10 +33,9 @@ enum E
|
|||||||
|
|
||||||
#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)
|
#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)
|
||||||
|
|
||||||
template<class T, class V> constexpr T test( V const& v )
|
template<class T, class V> constexpr T test( V const v )
|
||||||
{
|
{
|
||||||
V v2( v );
|
return get<T>( v );
|
||||||
return get<T>(v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@ -118,5 +110,3 @@ int main()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // constexpr lambda support
|
|
||||||
|
@ -6,13 +6,6 @@
|
|||||||
// See accompanying file LICENSE_1_0.txt or copy at
|
// See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#if !defined( __cpp_constexpr ) || __cpp_constexpr < 201603
|
|
||||||
|
|
||||||
// no constexpr lambda support
|
|
||||||
int main() {}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <boost/variant2/variant.hpp>
|
#include <boost/variant2/variant.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@ -44,7 +37,7 @@ enum E
|
|||||||
template<class T, class V> constexpr T test( V&& v )
|
template<class T, class V> constexpr T test( V&& v )
|
||||||
{
|
{
|
||||||
V v2( std::forward<V>(v) );
|
V v2( std::forward<V>(v) );
|
||||||
return get<T>(v);
|
return get<T>( v2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@ -109,5 +102,3 @@ int main()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // constexpr lambda support
|
|
||||||
|
Reference in New Issue
Block a user