Skip to content

Commit 578861e

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 578861e

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

build.jam

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ local cxx_requirements = [ requires
2828
cxx11_defaulted_functions
2929
cxx11_deleted_functions
3030
cxx11_function_template_default_args
31-
cxx11_hdr_type_traits
32-
] ;
31+
]
32+
[ check-target-builds config//has_sufficient_cxx11_type_traits "has <type_traits> sufficient for Boost.Scope" : : <build>no ]
33+
;
3334

3435
project /boost/scope
3536
: 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)