From c96cfb6c1818bbc15fd26a54f03de7facd629f39 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 19 Jun 2025 04:22:30 +0300 Subject: [PATCH] Relax C++11 type_traits requirements. This replaces the cxx11_hdr_type_traits requirement with a local configure-time check for the presence of only those type traits which are used in the library. This enables testing of gcc 4.8 and 4.9, which was previously silently skipped. --- build.jam | 30 ++++++++-------- config/Jamfile | 9 +++++ config/has_sufficient_cxx11_type_traits.cpp | 38 +++++++++++++++++++++ 3 files changed, 63 insertions(+), 14 deletions(-) create mode 100644 config/Jamfile create mode 100644 config/has_sufficient_cxx11_type_traits.cpp diff --git a/build.jam b/build.jam index e25a0ae..3fc2867 100644 --- a/build.jam +++ b/build.jam @@ -16,20 +16,22 @@ constant boost_dependencies : /boost/core//boost_core /boost/type_traits//boost_type_traits ; -local cxx_requirements = [ requires - exceptions - sfinae_expr - cxx11_constexpr - cxx11_noexcept - cxx11_decltype - cxx11_rvalue_references - cxx11_template_aliases - cxx11_variadic_templates - cxx11_defaulted_functions - cxx11_deleted_functions - cxx11_function_template_default_args - cxx11_hdr_type_traits -] ; +local cxx_requirements = + [ requires + exceptions + sfinae_expr + cxx11_constexpr + cxx11_noexcept + cxx11_decltype + cxx11_rvalue_references + cxx11_template_aliases + cxx11_variadic_templates + cxx11_defaulted_functions + cxx11_deleted_functions + cxx11_function_template_default_args + ] + [ check-target-builds config//has_sufficient_cxx11_type_traits "has sufficient for Boost.Scope" : : no ] + ; project /boost/scope : common-requirements diff --git a/config/Jamfile b/config/Jamfile new file mode 100644 index 0000000..48badef --- /dev/null +++ b/config/Jamfile @@ -0,0 +1,9 @@ +# +# Copyright Andrey Semashev 2025. +# Distributed under 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) +# + +obj has_sufficient_cxx11_type_traits : has_sufficient_cxx11_type_traits.cpp : /boost/config//boost_config ; +explicit has_sufficient_cxx11_type_traits ; diff --git a/config/has_sufficient_cxx11_type_traits.cpp b/config/has_sufficient_cxx11_type_traits.cpp new file mode 100644 index 0000000..6197592 --- /dev/null +++ b/config/has_sufficient_cxx11_type_traits.cpp @@ -0,0 +1,38 @@ +/* + * Copyright Andrey Semashev 2025. + * Distributed under 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) + */ + +// The test verifies that the compiler provides a header that is +// sufficient for Boost.Scope needs. + +#include + +int main(int, char*[]) +{ + using std::integral_constant; + using std::true_type; + using std::false_type; + using std::conditional; + using std::enable_if; + + using std::decay; + + using std::is_class; + using std::is_reference; + + using std::is_constructible; + using std::is_nothrow_constructible; + using std::is_move_constructible; + using std::is_nothrow_move_constructible; + using std::is_default_constructible; + using std::is_nothrow_default_constructible; + using std::is_assignable; + using std::is_nothrow_assignable; + using std::is_move_assignable; + using std::is_nothrow_move_assignable; + + return 0; +}