From 821c53c0b45529dca508fadc7d018fb1bb6ece21 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 15 Oct 2023 16:36:16 +0100 Subject: [PATCH] Add support for C++23 types. (#183) * Add support for C++23 types. * Update CI scripts. * Update C++20 testing in has_right_shift_test.cpp. --- .drone.star | 45 +++-------- .github/workflows/ci.yml | 81 ++++++++++++++++--- .../boost/type_traits/is_floating_point.hpp | 22 +++++ test/has_right_shift_test.cpp | 2 +- test/is_arithmetic_test.cpp | 36 +++++++++ test/is_floating_point_test.cpp | 36 +++++++++ test/is_fundamental_test.cpp | 36 +++++++++ test/is_pod_test.cpp | 44 ++++++++-- test/is_scalar_test.cpp | 42 ++++++++-- 9 files changed, 287 insertions(+), 57 deletions(-) diff --git a/.drone.star b/.drone.star index bdb1d43d21..f77bc9da89 100644 --- a/.drone.star +++ b/.drone.star @@ -14,40 +14,17 @@ windowsglobalimage="cppalliance/dronevs2019" def main(ctx): return [ - linux_cxx("TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x Job 1", "g++", packages="g++-4.4", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.4', 'CXXSTD': '98,0x'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x Job 2", "g++", packages="g++-4.6", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.6', 'CXXSTD': '03,0x'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11 Job 3", "g++-4.7", packages="g++-4.7", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.7', 'CXXSTD': '03,11'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11 Job 4", "g++-4.8", packages="g++-4.8", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.8', 'CXXSTD': '03,11'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11 Job 5", "g++-4.9", packages="g++-4.9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.9', 'CXXSTD': '03,11'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z Job 6", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z Job 7", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '03,11,14,1z', 'CXXSTD_DIALECT': 'cxxstd-dialect=gnu'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z Job 8", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z Job 9", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '03,11,14,1z', 'CXXSTD_DIALECT': 'cxxstd-dialect=gnu'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 Job 10", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '03,11,14,17'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17 Job 11", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '03,11,14,17'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-9 CXXSTD=03,11,14,17 Job 12", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '03,11,14,17,2a'}, globalenv=globalenv), - linux_cxx("TOOLSET=gcc COMPILER=g++-10 CXXSTD=03,11,14,17,20 Job 13", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '03,11,14,17,20'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03, Job 15", "clang++", packages="clang-3.5", llvm_os="precise", llvm_ver="3.5", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.5', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03, Job 16", "clang++", packages="clang-3.6", llvm_os="precise", llvm_ver="3.6", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.6', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03, Job 17", "clang++", packages="clang-3.7", llvm_os="precise", llvm_ver="3.7", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.7', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03, Job 18", "clang++-3.8", packages="clang-3.8", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.8', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03, Job 19", "clang++-3.9", packages="clang-3.9", llvm_os="precise", llvm_ver="3.9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.9', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03, Job 20", "clang++-4.0", packages="clang-4.0", llvm_os="xenial", llvm_ver="4.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03, Job 21", "clang++-5.0", packages="clang-5.0", llvm_os="xenial", llvm_ver="5.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-5.0 -stdlib=libc++ CXXSTD=03,11,14 Job 22", "clang++-5.0 -stdlib=libc++", packages="libc++-dev clang-5.0", llvm_os="xenial", llvm_ver="5.0", buildtype="boost", image=linuxglobalimage, environment={'COMPILER': 'clang++-5.0 -stdlib=libc++', 'TOOLSET': 'clang', 'CXXSTD': '03,11,14'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,1z, Job 23", "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-6.0 -stdlib=libc++ CXXSTD=03,11,14 Job 24", "clang++-6.0 -stdlib=libc++", packages="clang-6.0 libc++-dev", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image=linuxglobalimage, environment={'COMPILER': 'clang++-6.0 -stdlib=libc++', 'TOOLSET': 'clang', 'CXXSTD': '03,11,14'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11,14,1z Job 25", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-8 CXXSTD=03,11,14,17 2a Job 26", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '03,11,14,17,2a'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-9 CXXSTD=03,11,14,17,2a Job 27", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '03,11,14,17,2a'}, globalenv=globalenv), - linux_cxx("TOOLSET=clang COMPILER=clang++-10 CXXSTD=03,11,14,17,20 Job 28", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '03,11,14,17,20'}, globalenv=globalenv), - osx_cxx("XCode-11.7 CXXSTD=03,11,14,17,2a Job 29", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,17,2a', 'DRONE_JOB_OS_NAME': 'osx'}, globalenv=globalenv), - osx_cxx("XCode-10.2 CXXSTD=03,11,14,17,2a Job 30", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,17,2a', 'DRONE_JOB_OS_NAME': 'osx'}, globalenv=globalenv), - osx_cxx("XCode-9.4 CXXSTD=03,11,14,1z Job 31", "clang++", packages="", buildtype="boost", xcode_version="9.4", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_OS_NAME': 'osx'}, globalenv=globalenv), - osx_cxx("XCode-9.0 CXXSTD=03,11,14,1z Job 32", "clang++", packages="", buildtype="boost", xcode_version="9", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_OS_NAME': 'osx'}, globalenv=globalenv), - osx_cxx("XCode-8.3 CXXSTD=03,11,14,1z Job 33", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_OS_NAME': 'osx'}, globalenv=globalenv), - osx_cxx("XCode-8.0 CXXSTD=03,11,14,1z Job 34", "clang++", packages="", buildtype="boost", xcode_version="8", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_OS_NAME': 'osx'}, globalenv=globalenv), - osx_cxx("XCode-7.3 CXXSTD=03,11,14,1z Job 35", "clang++", packages="", buildtype="boost", xcode_version="7.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_OS_NAME': 'osx'}, globalenv=globalenv), + linux_cxx("TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '03,11,14,1z'}, globalenv=globalenv), + linux_cxx("TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z gnu++", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '03,11,14,1z', 'CXXSTD_DIALECT': 'cxxstd-dialect=gnu'}, globalenv=globalenv), + linux_cxx("TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '03,11,14,17'}, globalenv=globalenv), + linux_cxx("TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '03,11,14,17'}, globalenv=globalenv), + linux_cxx("TOOLSET=gcc COMPILER=g++-9 CXXSTD=03,11,14,17", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '03,11,14,17,2a'}, globalenv=globalenv), + linux_cxx("TOOLSET=gcc COMPILER=g++-10 CXXSTD=03,11,14,17,20", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '03,11,14,17,20'}, globalenv=globalenv), + linux_cxx("TOOLSET=clang COMPILER=clang++-9 CXXSTD=03,11,14,17,2a", "clang++-9", packages="clang-9", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '03,11,14,17,2a'}, globalenv=globalenv), + linux_cxx("TOOLSET=clang COMPILER=clang++-10 CXXSTD=03,11,14,17,20", "clang++-10", packages="clang-10", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '03,11,14,17,20'}, globalenv=globalenv), + linux_cxx("Ubuntu g++-13", packages="g++-13", buildtype="boost", image="cppalliance/droneubuntu2304:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-13', 'CXXSTD': '14,17,20,23', }, globalenv=globalenv), + osx_cxx("XCode-11.7 03,11,17,2a", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,17,2a', }, globalenv=globalenv), + osx_cxx("XCode-10.2 03,11,17,2a", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,17,2a', }, globalenv=globalenv), ] # from https://github.com/boostorg/boost-ci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 308b2cc67a..e9469c1586 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,12 +14,75 @@ on: release: types: [published, created, edited] jobs: - ubuntu-focal: - runs-on: ubuntu-20.04 + ubuntu-jammy: + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: - compiler: [ g++-9, g++-10, clang++-9, clang++-10 ] + compiler: [ g++-11, g++-12, clang++-14 ] + standard: [ c++03, c++11, c++14, c++17, c++2a, gnu++03, gnu++11, gnu++14, gnu++17, gnu++2a ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]' + commit-filter-separator: ';' + fail-fast: true + - name: Set TOOLSET + run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV + - name: Add repository + continue-on-error: true + id: addrepo + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo + continue-on-error: true + id: retry1 + if: steps.addrepo.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo 2 + continue-on-error: true + id: retry2 + if: steps.retry1.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install g++-11 g++-12 clang-14 + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/type_traits + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py type_traits + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: Generate headers + run: ./b2 headers + working-directory: ../boost-root + - name: Generate user config + run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' + working-directory: ../boost-root + - name: Config info install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=$TOOLSET + working-directory: ../boost-root/libs/type_traits/test + ubuntu-jammy-clang: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + compiler: [ clang++-11, clang++-12, clang++-13 ] standard: [ c++03, c++11, c++14, c++17, c++2a, gnu++03, gnu++11, gnu++14, gnu++17, gnu++2a ] steps: - uses: actions/checkout@v2 @@ -47,7 +110,7 @@ jobs: if: steps.retry1.outcome=='failure' run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - name: Install packages - run: sudo apt install g++-9 g++-10 clang-9 clang-10 libgmp-dev libmpfr-dev libfftw3-dev + run: sudo apt install clang-11 clang-12 clang-13 - name: Checkout main boost run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - name: Update tools/boostdep @@ -77,13 +140,13 @@ jobs: - name: Test run: ../../../b2 toolset=$TOOLSET working-directory: ../boost-root/libs/type_traits/test - ubuntu-bionic: - runs-on: ubuntu-18.04 + ubuntu-focal: + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - compiler: [ g++-7, g++-8, clang++-7, clang++-8 ] - standard: [ c++03, c++11, c++14, c++17, gnu++03, gnu++11, gnu++14, gnu++17 ] + compiler: [ g++-9, g++-10, clang++-9, clang++-10 ] + standard: [ c++03, c++11, c++14, c++17, c++2a, gnu++03, gnu++11, gnu++14, gnu++17, gnu++2a ] steps: - uses: actions/checkout@v2 with: @@ -110,7 +173,7 @@ jobs: if: steps.retry1.outcome=='failure' run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - name: Install packages - run: sudo apt install g++-7 g++-8 clang-7 clang-8 libgmp-dev libmpfr-dev libfftw3-dev + run: sudo apt install g++-9 g++-10 clang-9 clang-10 - name: Checkout main boost run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - name: Update tools/boostdep diff --git a/include/boost/type_traits/is_floating_point.hpp b/include/boost/type_traits/is_floating_point.hpp index 196c900cf9..f9f3d39567 100644 --- a/include/boost/type_traits/is_floating_point.hpp +++ b/include/boost/type_traits/is_floating_point.hpp @@ -10,6 +10,10 @@ #include +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#include +#endif + namespace boost { //* is a type T a floating-point type described in the standard (3.9.1p8) @@ -25,6 +29,24 @@ namespace boost { template<> struct is_floating_point<__float128> : public true_type{}; #endif +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#if defined(__STDCPP_FLOAT16_T__) + template<> struct is_floating_point : public true_type {}; +#endif +#if defined(__STDCPP_FLOAT32_T__) + template<> struct is_floating_point : public true_type {}; +#endif +#if defined(__STDCPP_FLOAT64_T__) + template<> struct is_floating_point : public true_type {}; +#endif +#if defined(__STDCPP_FLOAT128_T__) + template<> struct is_floating_point : public true_type {}; +#endif +#if defined(__STDCPP_BFLOAT16_T__) + template<> struct is_floating_point : public true_type {}; +#endif +#endif + } // namespace boost #endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED diff --git a/test/has_right_shift_test.cpp b/test/has_right_shift_test.cpp index d540e2f767..0661bb742d 100644 --- a/test/has_right_shift_test.cpp +++ b/test/has_right_shift_test.cpp @@ -234,7 +234,7 @@ BOOST_TT_PROC void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, char&, std::istream& >::value), 1); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, signed char&, std::istream& >::value), 1); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, unsigned char&, std::istream& >::value), 1); -#if !(defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 9000)) && !defined(_HAS_CXX20) +#if !(defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 9000)) && !defined(_HAS_CXX20) && (BOOST_CXX_VERSION < 202000) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, char*, std::istream& >::value), 1); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, signed char*, std::istream& >::value), 1); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, unsigned char*, std::istream& >::value), 1); diff --git a/test/is_arithmetic_test.cpp b/test/is_arithmetic_test.cpp index 13007cbfeb..e911d381b3 100644 --- a/test/is_arithmetic_test.cpp +++ b/test/is_arithmetic_test.cpp @@ -12,6 +12,10 @@ #include "test.hpp" #include "check_integral_constant.hpp" +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#include +#endif + TT_TEST_BEGIN(is_arithmetic) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); @@ -159,6 +163,38 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, t #ifdef BOOST_HAS_FLOAT128 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); #endif +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#if defined(__STDCPP_FLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +#endif +#if defined(__STDCPP_FLOAT32_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +#endif +#if defined(__STDCPP_FLOAT64_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +#endif +#if defined(__STDCPP_FLOAT128_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +#endif +#if defined(__STDCPP_BFLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +#endif +#endif TT_TEST_END diff --git a/test/is_floating_point_test.cpp b/test/is_floating_point_test.cpp index c9b15b03e3..fca569fad1 100644 --- a/test/is_floating_point_test.cpp +++ b/test/is_floating_point_test.cpp @@ -12,6 +12,10 @@ #include "test.hpp" #include "check_integral_constant.hpp" +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#include +#endif + TT_TEST_BEGIN(is_floating_point) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); @@ -35,6 +39,38 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); #endif +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#if defined(__STDCPP_FLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +#endif +#if defined(__STDCPP_FLOAT32_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +#endif +#if defined(__STDCPP_FLOAT64_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +#endif +#if defined(__STDCPP_FLOAT128_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +#endif +#if defined(__STDCPP_BFLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +#endif +#endif // // cases that should not be true: diff --git a/test/is_fundamental_test.cpp b/test/is_fundamental_test.cpp index ab97f9893f..6d2cd39c3b 100644 --- a/test/is_fundamental_test.cpp +++ b/test/is_fundamental_test.cpp @@ -12,6 +12,10 @@ #include "test.hpp" #include "check_integral_constant.hpp" +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#include +#endif + TT_TEST_BEGIN(is_fundamental) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); @@ -164,6 +168,38 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); #endif +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#if defined(__STDCPP_FLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +#endif +#if defined(__STDCPP_FLOAT32_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +#endif +#if defined(__STDCPP_FLOAT64_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +#endif +#if defined(__STDCPP_FLOAT128_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +#endif +#if defined(__STDCPP_BFLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +#endif +#endif TT_TEST_END diff --git a/test/is_pod_test.cpp b/test/is_pod_test.cpp index 861037c317..eab158da28 100644 --- a/test/is_pod_test.cpp +++ b/test/is_pod_test.cpp @@ -12,6 +12,10 @@ #include "test.hpp" #include "check_integral_constant.hpp" +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#include +#endif + TT_TEST_BEGIN(is_pod) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); @@ -186,12 +190,38 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); #endif -TT_TEST_END - - - - - - +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#if defined(__STDCPP_FLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +#endif +#if defined(__STDCPP_FLOAT32_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +#endif +#if defined(__STDCPP_FLOAT64_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +#endif +#if defined(__STDCPP_FLOAT128_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +#endif +#if defined(__STDCPP_BFLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +#endif +#endif +TT_TEST_END diff --git a/test/is_scalar_test.cpp b/test/is_scalar_test.cpp index 2017d0f00b..77b29afeef 100644 --- a/test/is_scalar_test.cpp +++ b/test/is_scalar_test.cpp @@ -12,6 +12,10 @@ #include "test.hpp" #include "check_integral_constant.hpp" +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#include +#endif + TT_TEST_BEGIN(is_scalar) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); @@ -165,13 +169,39 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); #endif +#ifndef BOOST_NO_CXX23_HDR_STDFLOAT +#if defined(__STDCPP_FLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +#endif +#if defined(__STDCPP_FLOAT32_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +#endif +#if defined(__STDCPP_FLOAT64_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +#endif +#if defined(__STDCPP_FLOAT128_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +#endif +#if defined(__STDCPP_BFLOAT16_T__) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +#endif +#endif TT_TEST_END - - - - - -