Skip to content

Commit c96cfb6

Browse files
committed
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.
1 parent 3e1e0a9 commit c96cfb6

3 files changed

Lines changed: 63 additions & 14 deletions

File tree

build.jam

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,22 @@ constant boost_dependencies :
1616
/boost/core//boost_core
1717
/boost/type_traits//boost_type_traits ;
1818

19-
local cxx_requirements = [ requires
20-
exceptions
21-
sfinae_expr
22-
cxx11_constexpr
23-
cxx11_noexcept
24-
cxx11_decltype
25-
cxx11_rvalue_references
26-
cxx11_template_aliases
27-
cxx11_variadic_templates
28-
cxx11_defaulted_functions
29-
cxx11_deleted_functions
30-
cxx11_function_template_default_args
31-
cxx11_hdr_type_traits
32-
] ;
19+
local cxx_requirements =
20+
[ requires
21+
exceptions
22+
sfinae_expr
23+
cxx11_constexpr
24+
cxx11_noexcept
25+
cxx11_decltype
26+
cxx11_rvalue_references
27+
cxx11_template_aliases
28+
cxx11_variadic_templates
29+
cxx11_defaulted_functions
30+
cxx11_deleted_functions
31+
cxx11_function_template_default_args
32+
]
33+
[ check-target-builds config//has_sufficient_cxx11_type_traits "has <type_traits> sufficient for Boost.Scope" : : <build>no ]
34+
;
3335

3436
project /boost/scope
3537
: common-requirements

config/Jamfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# Copyright Andrey Semashev 2025.
3+
# Distributed under the Boost Software License, Version 1.0.
4+
# (See accompanying file LICENSE_1_0.txt or copy at
5+
# http://www.boost.org/LICENSE_1_0.txt)
6+
#
7+
8+
obj has_sufficient_cxx11_type_traits : has_sufficient_cxx11_type_traits.cpp : <library>/boost/config//boost_config ;
9+
explicit has_sufficient_cxx11_type_traits ;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright Andrey Semashev 2025.
3+
* Distributed under the Boost Software License, Version 1.0.
4+
* (See accompanying file LICENSE_1_0.txt or copy at
5+
* http://www.boost.org/LICENSE_1_0.txt)
6+
*/
7+
8+
// The test verifies that the compiler provides a <type_traits> header that is
9+
// sufficient for Boost.Scope needs.
10+
11+
#include <type_traits>
12+
13+
int main(int, char*[])
14+
{
15+
using std::integral_constant;
16+
using std::true_type;
17+
using std::false_type;
18+
using std::conditional;
19+
using std::enable_if;
20+
21+
using std::decay;
22+
23+
using std::is_class;
24+
using std::is_reference;
25+
26+
using std::is_constructible;
27+
using std::is_nothrow_constructible;
28+
using std::is_move_constructible;
29+
using std::is_nothrow_move_constructible;
30+
using std::is_default_constructible;
31+
using std::is_nothrow_default_constructible;
32+
using std::is_assignable;
33+
using std::is_nothrow_assignable;
34+
using std::is_move_assignable;
35+
using std::is_nothrow_move_assignable;
36+
37+
return 0;
38+
}

0 commit comments

Comments
 (0)