diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index 30d279f5..70b000dd 100644 --- a/checks/Jamfile.v2 +++ b/checks/Jamfile.v2 @@ -1,6 +1,6 @@ # # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Sun Feb 5 18:12:09 2017 +# This file was automatically generated on Sun Feb 5 19:09:22 2017 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -116,6 +116,7 @@ run-simple TEST_BOOST_NO_CXX11_INLINE_NAMESPACES : cxx11_inline_namespac run-simple TEST_BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS : cxx11_non_public_defaulted_functions ; run-simple TEST_BOOST_NO_CXX11_NUMERIC_LIMITS : cxx11_numeric_limits ; run-simple TEST_BOOST_NO_CXX11_REF_QUALIFIERS : cxx11_ref_qualifiers ; +run-simple TEST_BOOST_NO_CXX11_SFINAE_EXPR : cxx11_sfinae_expr ; run-simple TEST_BOOST_NO_CXX11_SMART_PTR : cxx11_smart_ptr ; run-simple TEST_BOOST_NO_CXX11_STD_ALIGN : cxx11_std_align ; run-simple TEST_BOOST_NO_CXX11_THREAD_LOCAL : cxx11_thread_local ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index 9e12d855..0a9de081 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Sun Feb 5 18:12:09 2017 +// This file was automatically generated on Sun Feb 5 19:09:22 2017 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -397,6 +397,10 @@ namespace test = boost_no_cxx11_numeric_limits; # include "../test/boost_no_cxx11_ref_qualifiers.ipp" namespace test = boost_no_cxx11_ref_qualifiers; #endif +#ifdef TEST_BOOST_NO_CXX11_SFINAE_EXPR +# include "../test/boost_no_cxx11_sfinae_expr.ipp" +namespace test = boost_no_cxx11_sfinae_expr; +#endif #ifdef TEST_BOOST_NO_CXX11_SMART_PTR # include "../test/boost_no_cxx11_smart_ptr.ipp" namespace test = boost_no_cxx11_smart_ptr; diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index c4eda791..a88b6f9a 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -517,7 +517,7 @@ is covered by Core Language DR337, but is not part of the current standard. Fortunately most compilers that support SFINAE also support this - DR. + DR. See also BOOST_NO_SFINAE and BOOST_NO_SFINAE_EXPR

@@ -864,7 +864,8 @@

The compiler does not support the "Substitution Failure Is - Not An Error" meta-programming idiom. + Not An Error" meta-programming idiom. This is the lightweight + pre-C++11 version of SFINAE.

@@ -882,6 +883,8 @@

The compiler does not support usage of SFINAE with arbitrary expressions. + This is the post-C++11 SFINAE, but excludes a few specific corner + cases, see also BOOST_NO_CXX11_SFINAE_EXPR.

@@ -3073,6 +3076,22 @@ + +

+ BOOST_NO_CXX11_SFINAE_EXPR +

+ + +

+ The compiler does not support usage of C++11 SFINAE with arbitrary + expressions. Use this macro only if you are using all of the features + of SFINAE including substitution-failure-on-private-member-access. + Otherwise use BOOST_NO_SFINAE_EXPR or BOOST_NO_SFINAE which get + defined for fewer compilers. +

+ + +

BOOST_NO_CXX11_SMART_PTR diff --git a/doc/html/index.html b/doc/html/index.html index 5c633285..30d87ce1 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -990,7 +990,7 @@ - +

Last revised: February 05, 2017 at 19:01:00 GMT

Last revised: February 05, 2017 at 19:27:06 GMT


diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index d745bfa2..cb9d5972 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -138,7 +138,7 @@ The standard library lacks ``, `` or ``. [[`BOOST_NO_IS_ABSTRACT`][Compiler][ The C++ compiler does not support SFINAE with abstract types, this is covered by __CORE_LANGUAGE_DR337__, but is not part of the current standard. Fortunately -most compilers that support SFINAE also support this DR. +most compilers that support SFINAE also support this DR. See also BOOST_NO_SFINAE and BOOST_NO_SFINAE_EXPR ]] [[`BOOST_NO_LIMITS`][Standard library][ The C++ implementation does not provide the `` header. Never check for @@ -218,10 +218,11 @@ of an object is not supported. ]] [[`BOOST_NO_SFINAE`][Compiler][ The compiler does not support the "Substitution Failure Is Not An Error" -meta-programming idiom. +meta-programming idiom. This is the lightweight pre-C++11 version of SFINAE. ]] [[`BOOST_NO_SFINAE_EXPR`][Compiler][ -The compiler does not support usage of SFINAE with arbitrary expressions. +The compiler does not support usage of SFINAE with arbitrary expressions. This is the +post-C++11 SFINAE, but excludes a few specific corner cases, see also BOOST_NO_CXX11_SFINAE_EXPR. ]] [[`BOOST_NO_STD_ALLOCATOR`][Standard library][ The C++ standard library does not provide a standards conforming @@ -695,6 +696,11 @@ r-value references. [[`BOOST_NO_CXX11_SCOPED_ENUMS`][The compiler does not support scoped enumerations (`enum class`). ]] +[[`BOOST_NO_CXX11_SFINAE_EXPR`][The compiler does not support +usage of C++11 SFINAE with arbitrary expressions. Use this macro only if you +are using all of the features of SFINAE including substitution-failure-on-private-member-access. +Otherwise use BOOST_NO_SFINAE_EXPR or BOOST_NO_SFINAE which get defined for fewer compilers. +]] [[`BOOST_NO_CXX11_SMART_PTR`][The standard library header has no shared_ptr and unique_ptr.]] [[`BOOST_NO_CXX11_STATIC_ASSERT`][The compiler does not support `static_assert`. diff --git a/include/boost/config/compiler/borland.hpp b/include/boost/config/compiler/borland.hpp index ccd930ea..b749496e 100644 --- a/include/boost/config/compiler/borland.hpp +++ b/include/boost/config/compiler/borland.hpp @@ -185,6 +185,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS // UTF-8 still not supported #define BOOST_NO_CXX11_VARIADIC_TEMPLATES diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 150e3c0d..175229c6 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -57,7 +57,7 @@ #define BOOST_HAS_NRVO // Branch prediction hints -#if defined(__has_builtin) +#if !defined (__c2__) && defined(__has_builtin) #if __has_builtin(__builtin_expect) #define BOOST_LIKELY(x) __builtin_expect(x, 1) #define BOOST_UNLIKELY(x) __builtin_expect(x, 0) @@ -282,6 +282,10 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +#if __cplusplus < 201103L +#define BOOST_NO_CXX11_SFINAE_EXPR +#endif + #if __cplusplus < 201400 // All versions with __cplusplus above this value seem to support this: # define BOOST_NO_CXX14_DIGIT_SEPARATORS diff --git a/include/boost/config/compiler/codegear.hpp b/include/boost/config/compiler/codegear.hpp index e2f6061b..3c5262fe 100644 --- a/include/boost/config/compiler/codegear.hpp +++ b/include/boost/config/compiler/codegear.hpp @@ -112,6 +112,7 @@ #define BOOST_NO_CXX11_RAW_LITERALS #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS #define BOOST_NO_CXX11_VARIADIC_TEMPLATES diff --git a/include/boost/config/compiler/common_edg.hpp b/include/boost/config/compiler/common_edg.hpp index c09faeb0..eab93784 100644 --- a/include/boost/config/compiler/common_edg.hpp +++ b/include/boost/config/compiler/common_edg.hpp @@ -95,6 +95,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/cray.hpp b/include/boost/config/compiler/cray.hpp index 837f8152..eab52877 100644 --- a/include/boost/config/compiler/cray.hpp +++ b/include/boost/config/compiler/cray.hpp @@ -39,6 +39,7 @@ #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_RANGE_BASED_FOR diff --git a/include/boost/config/compiler/digitalmars.hpp b/include/boost/config/compiler/digitalmars.hpp index c344aae0..e371a68e 100644 --- a/include/boost/config/compiler/digitalmars.hpp +++ b/include/boost/config/compiler/digitalmars.hpp @@ -71,6 +71,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index e319d049..c82cbc7e 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -253,6 +253,7 @@ #if (BOOST_GCC_VERSION < 40800) || !defined(BOOST_GCC_CXX11) # define BOOST_NO_CXX11_ALIGNAS # define BOOST_NO_CXX11_THREAD_LOCAL +# define BOOST_NO_CXX11_SFINAE_EXPR #endif // C++0x features in 4.8.1 and later diff --git a/include/boost/config/compiler/gcc_xml.hpp b/include/boost/config/compiler/gcc_xml.hpp index b56c7862..63b08ac4 100644 --- a/include/boost/config/compiler/gcc_xml.hpp +++ b/include/boost/config/compiler/gcc_xml.hpp @@ -46,6 +46,7 @@ # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST # define BOOST_NO_CXX11_SCOPED_ENUMS # define BOOST_NO_SFINAE_EXPR +# define BOOST_NO_CXX11_SFINAE_EXPR # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS # define BOOST_NO_CXX11_LAMBDAS # define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS diff --git a/include/boost/config/compiler/hp_acc.hpp b/include/boost/config/compiler/hp_acc.hpp index a773b8c4..9df18eaf 100644 --- a/include/boost/config/compiler/hp_acc.hpp +++ b/include/boost/config/compiler/hp_acc.hpp @@ -114,6 +114,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/intel.hpp b/include/boost/config/compiler/intel.hpp index bf3f7d49..f55189a0 100644 --- a/include/boost/config/compiler/intel.hpp +++ b/include/boost/config/compiler/intel.hpp @@ -415,6 +415,11 @@ template<> struct assert_intrinsic_wchar_t {}; # undef BOOST_NO_SFINAE_EXPR #endif +// BOOST_NO_CXX11_SFINAE_EXPR +#if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40800)) && !defined(_MSC_VER) +# undef BOOST_NO_CXX11_SFINAE_EXPR +#endif + // BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS #if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40500)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827)) // This is available in earlier Intel releases, but breaks Multiprecision: diff --git a/include/boost/config/compiler/metrowerks.hpp b/include/boost/config/compiler/metrowerks.hpp index 3c5e2286..8d42563c 100644 --- a/include/boost/config/compiler/metrowerks.hpp +++ b/include/boost/config/compiler/metrowerks.hpp @@ -113,6 +113,7 @@ #define BOOST_NO_CXX11_RAW_LITERALS #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/mpw.hpp b/include/boost/config/compiler/mpw.hpp index 084f9e15..1b8d39ea 100644 --- a/include/boost/config/compiler/mpw.hpp +++ b/include/boost/config/compiler/mpw.hpp @@ -62,6 +62,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/pathscale.hpp b/include/boost/config/compiler/pathscale.hpp index a5e65af4..016ad5a4 100644 --- a/include/boost/config/compiler/pathscale.hpp +++ b/include/boost/config/compiler/pathscale.hpp @@ -37,6 +37,7 @@ # define BOOST_NO_CXX11_TEMPLATE_ALIASES # define BOOST_NO_CXX11_STATIC_ASSERT # define BOOST_NO_SFINAE_EXPR +# define BOOST_NO_CXX11_SFINAE_EXPR # define BOOST_NO_CXX11_SCOPED_ENUMS # define BOOST_NO_CXX11_RVALUE_REFERENCES # define BOOST_NO_CXX11_RANGE_BASED_FOR diff --git a/include/boost/config/compiler/pgi.hpp b/include/boost/config/compiler/pgi.hpp index fa2d5e40..af700514 100644 --- a/include/boost/config/compiler/pgi.hpp +++ b/include/boost/config/compiler/pgi.hpp @@ -88,6 +88,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_SWPRINTF #define BOOST_NO_CXX11_TEMPLATE_ALIASES diff --git a/include/boost/config/compiler/sunpro_cc.hpp b/include/boost/config/compiler/sunpro_cc.hpp index ac259fce..cdd30b14 100644 --- a/include/boost/config/compiler/sunpro_cc.hpp +++ b/include/boost/config/compiler/sunpro_cc.hpp @@ -141,6 +141,7 @@ // # define BOOST_HAS_LONG_LONG +#define BOOST_NO_CXX11_SFINAE_EXPR // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/include/boost/config/compiler/vacpp.hpp b/include/boost/config/compiler/vacpp.hpp index 3fbed9fa..b75a1bd1 100644 --- a/include/boost/config/compiler/vacpp.hpp +++ b/include/boost/config/compiler/vacpp.hpp @@ -114,6 +114,7 @@ # define BOOST_NO_CXX11_SCOPED_ENUMS #endif #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX #if ! __IBMCPP_STATIC_ASSERT # define BOOST_NO_CXX11_STATIC_ASSERT diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 78c50e51..24a88d5c 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -217,6 +217,7 @@ // C++ 11: // #define BOOST_NO_TWO_PHASE_NAME_LOOKUP +#define BOOST_NO_CXX11_SFINAE_EXPR // // Things that don't work in clr mode: diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index f08e63b8..24284bee 100644 --- a/test/all/Jamfile.v2 +++ b/test/all/Jamfile.v2 @@ -1,7 +1,7 @@ # # Regression test Jamfile for boost configuration setup. # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Sun Feb 5 18:12:09 2017 +# This file was automatically generated on Sun Feb 5 19:09:22 2017 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -313,6 +313,9 @@ test-suite "BOOST_NO_CXX11_NUMERIC_LIMITS" : test-suite "BOOST_NO_CXX11_REF_QUALIFIERS" : [ run ../no_cxx11_ref_qualifiers_pass.cpp ] [ compile-fail ../no_cxx11_ref_qualifiers_fail.cpp ] ; +test-suite "BOOST_NO_CXX11_SFINAE_EXPR" : +[ run ../no_cxx11_sfinae_expr_pass.cpp ] +[ compile-fail ../no_cxx11_sfinae_expr_fail.cpp ] ; test-suite "BOOST_NO_CXX11_SMART_PTR" : [ run ../no_cxx11_smart_ptr_pass.cpp ] [ compile-fail ../no_cxx11_smart_ptr_fail.cpp ] ; diff --git a/test/boost_no_cxx11_sfinae_expr.ipp b/test/boost_no_cxx11_sfinae_expr.ipp new file mode 100644 index 00000000..79cd7a85 --- /dev/null +++ b/test/boost_no_cxx11_sfinae_expr.ipp @@ -0,0 +1,46 @@ +/* +Copyright 2017 Glen Joseph Fernandes +(glenjofe@gmail.com) + +Distributed under Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +// MACRO: BOOST_NO_CXX11_SFINAE_EXPR +// TITLE: C++11 SFINAE for expressions +// DESCRIPTION: C++11 SFINAE for expressions not supported. + +namespace boost_no_cxx11_sfinae_expr { + +template +struct ignore { + typedef void type; +}; + +template +T& object(); + +template +struct trait { + static const int value = 0; +}; + +template +struct trait())>::type> { }; + +template +struct result { + static const int value = T::value; +}; + +class type { + void operator&() const { } +}; + +int test() +{ + return result >::value; +} + +} /* boost_no_cxx11_sfinae_expr */ diff --git a/test/config_info.cpp b/test/config_info.cpp index 3daccd31..13cab45a 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1053,6 +1053,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_CXX11_REF_QUALIFIERS); PRINT_MACRO(BOOST_NO_CXX11_RVALUE_REFERENCES); PRINT_MACRO(BOOST_NO_CXX11_SCOPED_ENUMS); + PRINT_MACRO(BOOST_NO_CXX11_SFINAE_EXPR); PRINT_MACRO(BOOST_NO_CXX11_SMART_PTR); PRINT_MACRO(BOOST_NO_CXX11_STATIC_ASSERT); PRINT_MACRO(BOOST_NO_CXX11_STD_ALIGN); @@ -1151,6 +1152,7 @@ void print_boost_macros() + // END GENERATED BLOCK PRINT_MACRO(BOOST_INTEL); diff --git a/test/config_test.cpp b/test/config_test.cpp index 0138bfd1..ddcdc6ba 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Sun Feb 5 18:12:09 2017 +// This file was automatically generated on Sun Feb 5 19:09:22 2017 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -242,6 +242,11 @@ namespace boost_no_cxx11_numeric_limits = empty_boost; #else namespace boost_no_cxx11_ref_qualifiers = empty_boost; #endif +#ifndef BOOST_NO_CXX11_SFINAE_EXPR +#include "boost_no_cxx11_sfinae_expr.ipp" +#else +namespace boost_no_cxx11_sfinae_expr = empty_boost; +#endif #ifndef BOOST_NO_CXX11_SMART_PTR #include "boost_no_cxx11_smart_ptr.ipp" #else @@ -1506,6 +1511,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX11_REF_QUALIFIERS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_cxx11_sfinae_expr::test()) + { + std::cerr << "Failed test for BOOST_NO_CXX11_SFINAE_EXPR at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_cxx11_smart_ptr::test()) { std::cerr << "Failed test for BOOST_NO_CXX11_SMART_PTR at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/no_cxx11_sfinae_expr_fail.cpp b/test/no_cxx11_sfinae_expr_fail.cpp new file mode 100644 index 00000000..1613f16e --- /dev/null +++ b/test/no_cxx11_sfinae_expr_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Sat Feb 4 00:49:07 2017 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_SFINAE_EXPR +// This file should not compile, if it does then +// BOOST_NO_CXX11_SFINAE_EXPR should not be defined. +// See file boost_no_cxx11_sfinae_expr.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifdef BOOST_NO_CXX11_SFINAE_EXPR +#include "boost_no_cxx11_sfinae_expr.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_sfinae_expr::test(); +} + diff --git a/test/no_cxx11_sfinae_expr_pass.cpp b/test/no_cxx11_sfinae_expr_pass.cpp new file mode 100644 index 00000000..15d988b0 --- /dev/null +++ b/test/no_cxx11_sfinae_expr_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Sat Feb 4 00:49:07 2017 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_SFINAE_EXPR +// This file should compile, if it does not then +// BOOST_NO_CXX11_SFINAE_EXPR should be defined. +// See file boost_no_cxx11_sfinae_expr.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifndef BOOST_NO_CXX11_SFINAE_EXPR +#include "boost_no_cxx11_sfinae_expr.ipp" +#else +namespace boost_no_cxx11_sfinae_expr = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_sfinae_expr::test(); +} +