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:
@@ -16,7 +16,8 @@ constant boost_dependencies :
|
||||
/boost/core//boost_core
|
||||
/boost/type_traits//boost_type_traits ;
|
||||
|
||||
local cxx_requirements = [ requires
|
||||
local cxx_requirements =
|
||||
[ requires
|
||||
exceptions
|
||||
sfinae_expr
|
||||
cxx11_constexpr
|
||||
@@ -28,8 +29,9 @@ local cxx_requirements = [ requires
|
||||
cxx11_defaulted_functions
|
||||
cxx11_deleted_functions
|
||||
cxx11_function_template_default_args
|
||||
cxx11_hdr_type_traits
|
||||
] ;
|
||||
]
|
||||
[ check-target-builds config//has_sufficient_cxx11_type_traits "has <type_traits> sufficient for Boost.Scope" : : <build>no ]
|
||||
;
|
||||
|
||||
project /boost/scope
|
||||
: common-requirements
|
||||
|
||||
9
config/Jamfile
Normal file
9
config/Jamfile
Normal 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 ;
|
||||
38
config/has_sufficient_cxx11_type_traits.cpp
Normal file
38
config/has_sufficient_cxx11_type_traits.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user