2
0
mirror of https://github.com/boostorg/scope.git synced 2026-01-19 04:42:10 +00:00

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.
This commit is contained in:
Andrey Semashev
2025-06-19 04:22:30 +03:00
parent 3e1e0a98b2
commit c96cfb6c18
3 changed files with 63 additions and 14 deletions

View File

@@ -16,20 +16,22 @@ constant boost_dependencies :
/boost/core//boost_core /boost/core//boost_core
/boost/type_traits//boost_type_traits ; /boost/type_traits//boost_type_traits ;
local cxx_requirements = [ requires local cxx_requirements =
exceptions [ requires
sfinae_expr exceptions
cxx11_constexpr sfinae_expr
cxx11_noexcept cxx11_constexpr
cxx11_decltype cxx11_noexcept
cxx11_rvalue_references cxx11_decltype
cxx11_template_aliases cxx11_rvalue_references
cxx11_variadic_templates cxx11_template_aliases
cxx11_defaulted_functions cxx11_variadic_templates
cxx11_deleted_functions cxx11_defaulted_functions
cxx11_function_template_default_args cxx11_deleted_functions
cxx11_hdr_type_traits cxx11_function_template_default_args
] ; ]
[ check-target-builds config//has_sufficient_cxx11_type_traits "has <type_traits> sufficient for Boost.Scope" : : <build>no ]
;
project /boost/scope project /boost/scope
: common-requirements : common-requirements

9
config/Jamfile Normal file
View File

@@ -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 : <library>/boost/config//boost_config ;
explicit has_sufficient_cxx11_type_traits ;

View File

@@ -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 <type_traits> header that is
// sufficient for Boost.Scope needs.
#include <type_traits>
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;
}