diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index fc74ed39..e39fa226 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 Fri Oct 14 20:08:50 2016 +# This file was automatically generated on Sun Dec 11 12:22:05 2016 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -9,7 +9,7 @@ import modules ; import path ; -import testing ; + rule run-simple ( requirements * : target-name ) { @@ -131,6 +131,7 @@ run-simple TEST_BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES : cxx14_initi run-simple TEST_BOOST_NO_CXX14_AGGREGATE_NSDMI : cxx14_aggregate_nsdmi ; run-simple TEST_BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION : cxx14_return_type_deduction ; run-simple TEST_BOOST_NO_CXX14_VARIABLE_TEMPLATES : cxx14_variable_templates ; +run-simple TEST_BOOST_NO_CXX17_STD_APPLY : cxx17_std_apply ; run-simple TEST_BOOST_NO_CXX17_STD_INVOKE : cxx17_std_invoke ; run-simple TEST_BOOST_NO_CXX11_HDR_FUNCTIONAL : cxx11_hdr_functional ; run-simple TEST_BOOST_NO_CXX11_DECLTYPE : cxx11_decltype ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index d3ad56ca..caad5bbf 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Fri Oct 14 20:08:50 2016 +// This file was automatically generated on Sun Dec 11 12:22:05 2016 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -457,6 +457,10 @@ namespace test = boost_no_cxx14_return_type_deduction; # include "../test/boost_no_cxx14_var_templ.ipp" namespace test = boost_no_cxx14_variable_templates; #endif +#ifdef TEST_BOOST_NO_CXX17_STD_APPLY +# include "../test/boost_no_cxx17_std_apply.ipp" +namespace test = boost_no_cxx17_std_apply; +#endif #ifdef TEST_BOOST_NO_CXX17_STD_INVOKE # include "../test/boost_no_cxx17_std_invoke.ipp" namespace test = boost_no_cxx17_std_invoke; diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index 5f7a0321..6094bcc1 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -159,6 +159,7 @@ // C++17 features #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) +# define BOOST_NO_CXX17_STD_APPLY # define BOOST_NO_CXX17_STD_INVOKE #endif diff --git a/include/boost/config/stdlib/libcomo.hpp b/include/boost/config/stdlib/libcomo.hpp index 07c48965..a7be537c 100644 --- a/include/boost/config/stdlib/libcomo.hpp +++ b/include/boost/config/stdlib/libcomo.hpp @@ -73,6 +73,7 @@ #endif // C++17 features +# define BOOST_NO_CXX17_STD_APPLY # define BOOST_NO_CXX17_STD_INVOKE // diff --git a/include/boost/config/stdlib/libcpp.hpp b/include/boost/config/stdlib/libcpp.hpp index dca0ea7b..d5d2fd61 100644 --- a/include/boost/config/stdlib/libcpp.hpp +++ b/include/boost/config/stdlib/libcpp.hpp @@ -83,6 +83,9 @@ #if (_LIBCPP_VERSION < 3700) || (__cplusplus <= 201402L) # define BOOST_NO_CXX17_STD_INVOKE #endif +#if (_LIBCPP_VERSION < 4000) || (__cplusplus <= 201402L) +# define BOOST_NO_CXX17_STD_APPLY +#endif #if (_LIBCPP_VERSION <= 1101) && !defined(BOOST_NO_CXX11_THREAD_LOCAL) // This is a bit of a sledgehammer, because really it's just libc++abi that has no diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index d4596498..1cbebb87 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -261,6 +261,9 @@ #if (BOOST_LIBSTDCXX_VERSION < 60100) || (__cplusplus <= 201402L) # define BOOST_NO_CXX17_STD_INVOKE #endif +#if (BOOST_LIBSTDCXX_VERSION < 70100) || (__cplusplus <= 201402L) +# define BOOST_NO_CXX17_STD_APPLY +#endif #if defined(__has_include) #if !__has_include() diff --git a/include/boost/config/stdlib/modena.hpp b/include/boost/config/stdlib/modena.hpp index 7092e9ba..27ca4531 100644 --- a/include/boost/config/stdlib/modena.hpp +++ b/include/boost/config/stdlib/modena.hpp @@ -62,6 +62,7 @@ #endif // C++17 features +# define BOOST_NO_CXX17_STD_APPLY # define BOOST_NO_CXX17_STD_INVOKE #define BOOST_STDLIB "Modena C++ standard library" diff --git a/include/boost/config/stdlib/msl.hpp b/include/boost/config/stdlib/msl.hpp index ce60b7ee..c9e6b281 100644 --- a/include/boost/config/stdlib/msl.hpp +++ b/include/boost/config/stdlib/msl.hpp @@ -86,6 +86,7 @@ #endif // C++17 features +# define BOOST_NO_CXX17_STD_APPLY # define BOOST_NO_CXX17_STD_INVOKE #define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__) diff --git a/include/boost/config/stdlib/roguewave.hpp b/include/boost/config/stdlib/roguewave.hpp index e87ec78d..420fa26b 100644 --- a/include/boost/config/stdlib/roguewave.hpp +++ b/include/boost/config/stdlib/roguewave.hpp @@ -198,4 +198,5 @@ #endif // C++17 features +# define BOOST_NO_CXX17_STD_APPLY # define BOOST_NO_CXX17_STD_INVOKE diff --git a/include/boost/config/stdlib/sgi.hpp b/include/boost/config/stdlib/sgi.hpp index 1623de38..a1ef7343 100644 --- a/include/boost/config/stdlib/sgi.hpp +++ b/include/boost/config/stdlib/sgi.hpp @@ -156,6 +156,7 @@ #endif // C++17 features +# define BOOST_NO_CXX17_STD_APPLY # define BOOST_NO_CXX17_STD_INVOKE #define BOOST_STDLIB "SGI standard library" diff --git a/include/boost/config/stdlib/stlport.hpp b/include/boost/config/stdlib/stlport.hpp index 6d796128..971b7813 100644 --- a/include/boost/config/stdlib/stlport.hpp +++ b/include/boost/config/stdlib/stlport.hpp @@ -246,6 +246,7 @@ namespace boost { using std::min; using std::max; } #endif // C++17 features +# define BOOST_NO_CXX17_STD_APPLY # define BOOST_NO_CXX17_STD_INVOKE #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT) diff --git a/include/boost/config/stdlib/vacpp.hpp b/include/boost/config/stdlib/vacpp.hpp index 0876cf8c..9d93ae4e 100644 --- a/include/boost/config/stdlib/vacpp.hpp +++ b/include/boost/config/stdlib/vacpp.hpp @@ -62,6 +62,7 @@ #endif // C++17 features +# define BOOST_NO_CXX17_STD_APPLY # define BOOST_NO_CXX17_STD_INVOKE #define BOOST_STDLIB "Visual Age default standard library" diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index d76b6cf3..c7b9a4f3 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 Fri Oct 14 20:08:50 2016 +# This file was automatically generated on Sun Dec 11 12:22:04 2016 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -358,6 +358,9 @@ test-suite "BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION" : test-suite "BOOST_NO_CXX14_VARIABLE_TEMPLATES" : [ run ../no_cxx14_var_templ_pass.cpp ] [ compile-fail ../no_cxx14_var_templ_fail.cpp ] ; +test-suite "BOOST_NO_CXX17_STD_APPLY" : +[ run ../no_cxx17_std_apply_pass.cpp ] +[ compile-fail ../no_cxx17_std_apply_fail.cpp ] ; test-suite "BOOST_NO_CXX17_STD_INVOKE" : [ run ../no_cxx17_std_invoke_pass.cpp ] [ compile-fail ../no_cxx17_std_invoke_fail.cpp ] ; diff --git a/test/boost_no_cxx17_std_apply.ipp b/test/boost_no_cxx17_std_apply.ipp new file mode 100644 index 00000000..c657c039 --- /dev/null +++ b/test/boost_no_cxx17_std_apply.ipp @@ -0,0 +1,28 @@ +// (C) Copyright Oliver Kowalke 2016. +// 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 most recent version. + +// MACRO: BOOST_NO_CXX17_STD_APPLY +// TITLE: apply +// DESCRIPTION: The compiler supports the std::apply() function. + +#include +#include + +namespace boost_no_cxx17_std_apply { + +int foo( int i, int j) { + return i + j; +} + +int test() { + int i = 1, j = 2; + std::apply( foo, std::make_tuple( i, j) ); + return 0; +} + +} + diff --git a/test/config_info.cpp b/test/config_info.cpp index 8bb1e441..0e67f71b 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1074,6 +1074,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES); PRINT_MACRO(BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION); PRINT_MACRO(BOOST_NO_CXX14_VARIABLE_TEMPLATES); + PRINT_MACRO(BOOST_NO_CXX17_STD_APPLY); PRINT_MACRO(BOOST_NO_CXX17_STD_INVOKE); PRINT_MACRO(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS); PRINT_MACRO(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS); @@ -1145,6 +1146,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 a887972d..2e4c23e3 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Fri Oct 14 20:08:50 2016 +// This file was automatically generated on Sun Dec 11 12:22:04 2016 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -317,6 +317,11 @@ namespace boost_no_cxx14_return_type_deduction = empty_boost; #else namespace boost_no_cxx14_variable_templates = empty_boost; #endif +#ifndef BOOST_NO_CXX17_STD_APPLY +#include "boost_no_cxx17_std_apply.ipp" +#else +namespace boost_no_cxx17_std_apply = empty_boost; +#endif #ifndef BOOST_NO_CXX17_STD_INVOKE #include "boost_no_cxx17_std_invoke.ipp" #else @@ -1566,6 +1571,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX14_VARIABLE_TEMPLATES at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_cxx17_std_apply::test()) + { + std::cerr << "Failed test for BOOST_NO_CXX17_STD_APPLY at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_cxx17_std_invoke::test()) { std::cerr << "Failed test for BOOST_NO_CXX17_STD_INVOKE at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/no_cxx17_std_apply_fail.cpp b/test/no_cxx17_std_apply_fail.cpp new file mode 100644 index 00000000..e1c3d367 --- /dev/null +++ b/test/no_cxx17_std_apply_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Fri Oct 14 12:13:46 2016 +// 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_CXX17_STD_APPLY +// This file should not compile, if it does then +// BOOST_NO_CXX17_STD_APPLY should not be defined. +// See file boost_no_cxx17_std_apply.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_CXX17_STD_APPLY +#include "boost_no_cxx17_std_apply.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_std_apply::test(); +} + diff --git a/test/no_cxx17_std_apply_pass.cpp b/test/no_cxx17_std_apply_pass.cpp new file mode 100644 index 00000000..b3aa8744 --- /dev/null +++ b/test/no_cxx17_std_apply_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Fri Oct 14 12:13:46 2016 +// 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_CXX17_STD_APPLY +// This file should compile, if it does not then +// BOOST_NO_CXX!/_STD_APPLY should be defined. +// See file boost_no_cxx17_std_apply.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_CXX17_STD_APPLY +#include "boost_no_cxx17_std_apply.ipp" +#else +namespace boost_no_cxx17_std_apply = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_std_apply::test(); +} +