forked from boostorg/type_traits
Compare commits
12 Commits
pr/char8_t
...
cpp23
Author | SHA1 | Date | |
---|---|---|---|
bcf13faa6e | |||
2aa059c25a | |||
7eb660f1a9 | |||
6433e2fa79 | |||
1573a2c473 | |||
1ebd31e60e | |||
155cb2e47c | |||
5f43b22861 | |||
fc61f298bf | |||
1c31fee575 | |||
2370288a79 | |||
6ffc0e5ebd |
45
.drone.star
45
.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
|
||||
|
193
.github/workflows/ci.yml
vendored
193
.github/workflows/ci.yml
vendored
@ -14,6 +14,132 @@ on:
|
||||
release:
|
||||
types: [published, created, edited]
|
||||
jobs:
|
||||
ubuntu-jammy:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
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 }} : <cxxflags>-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
|
||||
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 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
|
||||
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 }} : <cxxflags>-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-focal:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
@ -47,70 +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++-9 g++-10 clang-9 clang-10 libgmp-dev libmpfr-dev libfftw3-dev
|
||||
- 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 }} : <cxxflags>-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-bionic:
|
||||
runs-on: ubuntu-18.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 ]
|
||||
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++-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
|
||||
@ -236,7 +299,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
standard: [ 14, 17 ]
|
||||
standard: [ 14 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
|
@ -1,4 +1,4 @@
|
||||
[/
|
||||
[/
|
||||
Copyright 2009 John Maddock.
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -7,6 +7,11 @@
|
||||
|
||||
[section:history History]
|
||||
|
||||
[h4 Boost-1.82.0]
|
||||
|
||||
* Added __is_swappable trait.
|
||||
* Added a workaround for gcc 4.6 that allows __is_nothrow_swappable to work.
|
||||
|
||||
[h4 Boost-1.70.0]
|
||||
|
||||
* Added new traits __is_bounded_array, __is_unbounded_array, __copy_reference, __copy_cv_ref.
|
||||
|
@ -1148,7 +1148,15 @@
|
||||
All traits are implemented the same way using preprocessor macros to avoid
|
||||
code duplication. The main files are in <code class="literal">boost/type_traits/detail</code>:
|
||||
<code class="literal">has_binary_operator.hpp</code>, <code class="literal">has_prefix_operator.hpp</code>
|
||||
and <code class="literal">has_postfix_operator.hpp</code>. The example of prefix
|
||||
and <code class="literal">has_postfix_operator.hpp</code>.
|
||||
</p>
|
||||
<p>
|
||||
Given a sufficiently conforming C++11 compiler, these traits are implemented
|
||||
in a rather compact and straightforward way that should always give accurate
|
||||
answers.
|
||||
</p>
|
||||
<p>
|
||||
In C++03 there is a legacy implementation, by way of example the prefix
|
||||
<code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code>
|
||||
is presented below:
|
||||
</p>
|
||||
@ -1324,7 +1332,7 @@
|
||||
<span class="phrase"><a name="boost_typetraits.category.value_traits.operators.limitation"></a></span><a class="link" href="operators.html#boost_typetraits.category.value_traits.operators.limitation">Limitation</a>
|
||||
</h6>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||||
Requires a compiler with working SFINAE.
|
||||
Prior to C++11, requires a compiler with working SFINAE.
|
||||
</li></ul></div>
|
||||
<h6>
|
||||
<a name="boost_typetraits.category.value_traits.operators.h6"></a>
|
||||
@ -1333,21 +1341,22 @@
|
||||
</h6>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
These traits cannot detect whether the operators are public or not:
|
||||
if an operator is defined as a private member of type <code class="computeroutput"><span class="identifier">T</span></code> then the instantiation of the corresponding
|
||||
trait will produce a compiler error. For this reason these traits cannot
|
||||
be used to determine whether a type has a public operator or not.
|
||||
Prior to C++11, these traits cannot detect whether the operators are
|
||||
public or not: if an operator is defined as a private member of type
|
||||
<code class="computeroutput"><span class="identifier">T</span></code> then the instantiation
|
||||
of the corresponding trait will produce a compiler error. For this
|
||||
reason these traits cannot be used to determine whether a type has
|
||||
a public operator or not.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="keyword">private</span><span class="special">:</span> <span class="identifier">A</span> <span class="keyword">operator</span><span class="special">-();</span> <span class="special">};</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_unary_minus</span><span class="special"><</span><span class="identifier">A</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span> <span class="comment">// error: A::operator-() is private</span>
|
||||
</pre>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
There is an issue if the operator exists only for type <code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code>
|
||||
is convertible to <code class="computeroutput"><span class="identifier">A</span></code>.
|
||||
In this case, the compiler will report an ambiguous overload because
|
||||
both the existing operator and the one we provide (with argument of
|
||||
type <code class="computeroutput"><span class="identifier">any</span></code>) need type
|
||||
conversion, so that none is preferred.
|
||||
Prior to C++11, there is an issue if the operator exists only for type
|
||||
<code class="computeroutput"><span class="identifier">A</span></code> and <code class="computeroutput"><span class="identifier">B</span></code> is convertible to <code class="computeroutput"><span class="identifier">A</span></code>. In this case, the compiler will
|
||||
report an ambiguous overload because both the existing operator and
|
||||
the one we provide (with argument of type <code class="computeroutput"><span class="identifier">any</span></code>)
|
||||
need type conversion, so that none is preferred.
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&);</span>
|
||||
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{</span> <span class="keyword">operator</span> <span class="identifier">A</span><span class="special">();</span> <span class="special">};</span>
|
||||
@ -1388,7 +1397,7 @@
|
||||
|
||||
<span class="keyword">class</span> <span class="identifier">bad</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">class</span> <span class="identifier">good</span> <span class="special">{</span> <span class="special">};</span>
|
||||
<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="special">}</span>
|
||||
<span class="keyword">bool</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">good</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">good</span><span class="special">&)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span> <span class="special">}</span>
|
||||
|
||||
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
|
||||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"><<</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span><span class="special">;</span>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1124648"></a>Class Index</h2></div></div></div>
|
||||
<a name="id1192383"></a>Class Index</h2></div></div></div>
|
||||
<p><a class="link" href="s11.html#idx_id_0">A</a> <a class="link" href="s11.html#idx_id_2">C</a> <a class="link" href="s11.html#idx_id_3">D</a> <a class="link" href="s11.html#idx_id_4">E</a> <a class="link" href="s11.html#idx_id_5">F</a> <a class="link" href="s11.html#idx_id_6">H</a> <a class="link" href="s11.html#idx_id_7">I</a> <a class="link" href="s11.html#idx_id_8">M</a> <a class="link" href="s11.html#idx_id_9">N</a> <a class="link" href="s11.html#idx_id_10">O</a> <a class="link" href="s11.html#idx_id_11">P</a> <a class="link" href="s11.html#idx_id_12">R</a> <a class="link" href="s11.html#idx_id_13">T</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1128255"></a>Typedef Index</h2></div></div></div>
|
||||
<a name="id1195400"></a>Typedef Index</h2></div></div></div>
|
||||
<p><a class="link" href="s12.html#idx_id_21">F</a> <a class="link" href="s12.html#idx_id_28">R</a> <a class="link" href="s12.html#idx_id_29">T</a> <a class="link" href="s12.html#idx_id_31">V</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1128464"></a>Macro Index</h2></div></div></div>
|
||||
<a name="id1195591"></a>Macro Index</h2></div></div></div>
|
||||
<p><a class="link" href="s13.html#idx_id_33">B</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
|
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1130188"></a>Index</h2></div></div></div>
|
||||
<a name="id1196594"></a>Index</h2></div></div></div>
|
||||
<p><a class="link" href="s14.html#idx_id_48">A</a> <a class="link" href="s14.html#idx_id_49">B</a> <a class="link" href="s14.html#idx_id_50">C</a> <a class="link" href="s14.html#idx_id_51">D</a> <a class="link" href="s14.html#idx_id_52">E</a> <a class="link" href="s14.html#idx_id_53">F</a> <a class="link" href="s14.html#idx_id_54">H</a> <a class="link" href="s14.html#idx_id_55">I</a> <a class="link" href="s14.html#idx_id_56">M</a> <a class="link" href="s14.html#idx_id_57">N</a> <a class="link" href="s14.html#idx_id_58">O</a> <a class="link" href="s14.html#idx_id_59">P</a> <a class="link" href="s14.html#idx_id_60">R</a> <a class="link" href="s14.html#idx_id_61">T</a> <a class="link" href="s14.html#idx_id_62">U</a> <a class="link" href="s14.html#idx_id_63">V</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
|
26
doc/is_swappable.qbk
Normal file
26
doc/is_swappable.qbk
Normal file
@ -0,0 +1,26 @@
|
||||
[/
|
||||
Copyright 2023 Andrey Semashev
|
||||
|
||||
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).
|
||||
]
|
||||
|
||||
[section:is_swappable is_swappable]
|
||||
|
||||
template <class T>
|
||||
struct is_swappable : public __tof {};
|
||||
|
||||
__inherit If the expression `swap(declval<T&>(), declval<T&>())` (in a context
|
||||
where `std::swap` is visible) is valid, inherits from __true_type, otherwise from __false_type.
|
||||
|
||||
__compat This trait requires C++11 for full support. On C++03 compilers it will inherit from __true_type
|
||||
for scalar types (including integral, floating point, enumeration, pointer and pointer-to-member types)
|
||||
and from __false_type for anything else. If MSVC standard library is used, C++17
|
||||
is required for full support. In this case, in C++11 and C++14 modes the trait will inherit from __true_type
|
||||
for types that support move construction and move assignment and from __false_type for other types.
|
||||
|
||||
__header ` #include <boost/type_traits/is_swappable.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
[endsect]
|
@ -247,7 +247,11 @@ All traits are implemented the same way using preprocessor macros to avoid code
|
||||
duplication.
|
||||
The main files are in [^boost/type_traits/detail]: [^has_binary_operator.hpp],
|
||||
[^has_prefix_operator.hpp] and [^has_postfix_operator.hpp].
|
||||
The example of prefix `operator-` is presented below:
|
||||
|
||||
Given a sufficiently conforming C++11 compiler, these traits are implemented in a rather
|
||||
compact and straightforward way that should always give accurate answers.
|
||||
|
||||
In C++03 there is a legacy implementation, by way of example the prefix `operator-` is presented below:
|
||||
|
||||
``
|
||||
namespace boost {
|
||||
@ -416,11 +420,11 @@ struct has_unary_minus : ::boost::integral_constant<bool,(::boost::detail::has_u
|
||||
|
||||
[heading Limitation]
|
||||
|
||||
* Requires a compiler with working SFINAE.
|
||||
* Prior to C++11, requires a compiler with working SFINAE.
|
||||
|
||||
[heading Known issues]
|
||||
|
||||
* These traits cannot detect whether the operators are public or not:
|
||||
* Prior to C++11, these traits cannot detect whether the operators are public or not:
|
||||
if an operator is defined as a private member of type `T` then
|
||||
the instantiation of the corresponding trait will produce a compiler error.
|
||||
For this reason these traits cannot be used to determine whether a type has a
|
||||
@ -430,7 +434,7 @@ struct A { private: A operator-(); };
|
||||
boost::has_unary_minus<A>::value; // error: A::operator-() is private
|
||||
``
|
||||
|
||||
* There is an issue if the operator exists only for type `A` and `B` is
|
||||
* Prior to C++11, there is an issue if the operator exists only for type `A` and `B` is
|
||||
convertible to `A`. In this case, the compiler will report an ambiguous overload
|
||||
because both the existing operator and the one we provide (with argument of type
|
||||
`any`) need type conversion, so that none is preferred.
|
||||
|
@ -108,6 +108,7 @@
|
||||
[def __is_nothrow_move_constructible [link boost_typetraits.reference.is_nothrow_move_constructible is_nothrow_move_constructible]]
|
||||
[def __has_nothrow_assign [link boost_typetraits.reference.has_nothrow_assign has_nothrow_assign]]
|
||||
[def __is_nothrow_move_assignable [link boost_typetraits.reference.is_nothrow_move_assignable is_nothrow_move_assignable]]
|
||||
[def __is_swappable [link boost_typetraits.reference.is_swappable is_swappable]]
|
||||
[def __is_nothrow_swappable [link boost_typetraits.reference.is_nothrow_swappable is_nothrow_swappable]]
|
||||
|
||||
[def __is_base_of [link boost_typetraits.reference.is_base_of is_base_of]]
|
||||
@ -440,6 +441,7 @@ See __has_trivial_constructor.
|
||||
[include is_scoped_enum.qbk]
|
||||
[include is_signed.qbk]
|
||||
[include is_stateless.qbk]
|
||||
[include is_swappable.qbk]
|
||||
[include is_trivially_copyable.qbk]
|
||||
[include is_unbounded_array.qbk]
|
||||
[include is_union.qbk]
|
||||
|
@ -131,6 +131,7 @@
|
||||
#include <boost/type_traits/is_scoped_enum.hpp>
|
||||
#include <boost/type_traits/is_signed.hpp>
|
||||
#include <boost/type_traits/is_stateless.hpp>
|
||||
#include <boost/type_traits/is_swappable.hpp>
|
||||
#include <boost/type_traits/is_trivially_copyable.hpp>
|
||||
#include <boost/type_traits/is_union.hpp>
|
||||
#include <boost/type_traits/is_unscoped_enum.hpp>
|
||||
|
70
include/boost/type_traits/detail/is_swappable_cxx_11.hpp
Normal file
70
include/boost/type_traits/detail/is_swappable_cxx_11.hpp
Normal file
@ -0,0 +1,70 @@
|
||||
#ifndef BOOST_TYPE_TRAITS_DETAIL_IS_SWAPPABLE_CXX_11_HPP_INCLUDED
|
||||
#define BOOST_TYPE_TRAITS_DETAIL_IS_SWAPPABLE_CXX_11_HPP_INCLUDED
|
||||
|
||||
// Copyright 2017 Peter Dimov
|
||||
// Copyright 2023 Andrey Semashev
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#if __cplusplus >= 201103L || defined(BOOST_DINKUMWARE_STDLIB)
|
||||
#include <utility> // for std::swap (C++11)
|
||||
#else
|
||||
#include <algorithm> // for std::swap (C++98)
|
||||
#endif
|
||||
|
||||
// Intentionally not within boost namespace to avoid implicitly pulling in boost::swap overloads other than through ADL
|
||||
namespace boost_type_traits_swappable_detail
|
||||
{
|
||||
|
||||
using std::swap;
|
||||
|
||||
template<class T, class U, class = decltype(swap(boost::declval<T>(), boost::declval<U>()))> boost::true_type is_swappable_with_impl( int );
|
||||
template<class T, class U> boost::false_type is_swappable_with_impl( ... );
|
||||
template<class T, class U>
|
||||
struct is_swappable_with_helper { typedef decltype( boost_type_traits_swappable_detail::is_swappable_with_impl<T, U>(0) ) type; };
|
||||
|
||||
template<class T, class = decltype(swap(boost::declval<T&>(), boost::declval<T&>()))> boost::true_type is_swappable_impl( int );
|
||||
template<class T> boost::false_type is_swappable_impl( ... );
|
||||
template<class T>
|
||||
struct is_swappable_helper { typedef decltype( boost_type_traits_swappable_detail::is_swappable_impl<T>(0) ) type; };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_NOEXCEPT)
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_GCC, < 40700)
|
||||
|
||||
// gcc 4.6 ICEs when noexcept operator is used on an invalid expression
|
||||
template<class T, class U, bool = is_swappable_with_helper<T, U>::type::value>
|
||||
struct is_nothrow_swappable_with_helper { typedef boost::false_type type; };
|
||||
template<class T, class U>
|
||||
struct is_nothrow_swappable_with_helper<T, U, true> { typedef boost::integral_constant<bool, noexcept(swap(boost::declval<T>(), boost::declval<U>()))> type; };
|
||||
|
||||
template<class T, bool = is_swappable_helper<T>::type::value>
|
||||
struct is_nothrow_swappable_helper { typedef boost::false_type type; };
|
||||
template<class T>
|
||||
struct is_nothrow_swappable_helper<T, true> { typedef boost::integral_constant<bool, noexcept(swap(boost::declval<T&>(), boost::declval<T&>()))> type; };
|
||||
|
||||
#else // BOOST_WORKAROUND(BOOST_GCC, < 40700)
|
||||
|
||||
template<class T, class U, bool B = noexcept(swap(boost::declval<T>(), boost::declval<U>()))> boost::integral_constant<bool, B> is_nothrow_swappable_with_impl( int );
|
||||
template<class T, class U> boost::false_type is_nothrow_swappable_with_impl( ... );
|
||||
template<class T, class U>
|
||||
struct is_nothrow_swappable_with_helper { typedef decltype( boost_type_traits_swappable_detail::is_nothrow_swappable_with_impl<T, U>(0) ) type; };
|
||||
|
||||
template<class T, bool B = noexcept(swap(boost::declval<T&>(), boost::declval<T&>()))> boost::integral_constant<bool, B> is_nothrow_swappable_impl( int );
|
||||
template<class T> boost::false_type is_nothrow_swappable_impl( ... );
|
||||
template<class T>
|
||||
struct is_nothrow_swappable_helper { typedef decltype( boost_type_traits_swappable_detail::is_nothrow_swappable_impl<T>(0) ) type; };
|
||||
|
||||
#endif // BOOST_WORKAROUND(BOOST_GCC, < 40700)
|
||||
|
||||
#endif // !defined(BOOST_NO_CXX11_NOEXCEPT)
|
||||
|
||||
} // namespace boost_type_traits_swappable_detail
|
||||
|
||||
#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_IS_SWAPPABLE_CXX_11_HPP_INCLUDED
|
@ -10,6 +10,10 @@
|
||||
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#include <stdfloat>
|
||||
#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<std::float16_t> : public true_type {};
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT32_T__)
|
||||
template<> struct is_floating_point<std::float32_t> : public true_type {};
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT64_T__)
|
||||
template<> struct is_floating_point<std::float64_t> : public true_type {};
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT128_T__)
|
||||
template<> struct is_floating_point<std::float128_t> : public true_type {};
|
||||
#endif
|
||||
#if defined(__STDCPP_BFLOAT16_T__)
|
||||
template<> struct is_floating_point<std::bfloat16_t> : public true_type {};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED
|
||||
|
@ -8,10 +8,9 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_DECLTYPE) \
|
||||
|| defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) || BOOST_WORKAROUND(BOOST_GCC, < 40700)
|
||||
|| defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
@ -28,35 +27,16 @@ template <class T> struct is_nothrow_swappable_with<T, T> : is_nothrow_swappable
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <algorithm>
|
||||
#include <boost/type_traits/detail/is_swappable_cxx_11.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace type_traits_swappable_detail
|
||||
{
|
||||
|
||||
using std::swap;
|
||||
|
||||
template<class T, class U, bool B = noexcept(swap(declval<T>(), declval<U>()))> integral_constant<bool, B> is_nothrow_swappable_with_impl( int );
|
||||
template<class T, class U> false_type is_nothrow_swappable_with_impl( ... );
|
||||
template<class T, class U>
|
||||
struct is_nothrow_swappable_with_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_with_impl<T, U>(0) ) type; };
|
||||
|
||||
template<class T, bool B = noexcept(swap(declval<T&>(), declval<T&>()))> integral_constant<bool, B> is_nothrow_swappable_impl( int );
|
||||
template<class T> false_type is_nothrow_swappable_impl( ... );
|
||||
template<class T>
|
||||
struct is_nothrow_swappable_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_impl<T>(0) ) type; };
|
||||
|
||||
} // namespace type_traits_swappable_detail
|
||||
|
||||
template<class T, class U> struct is_nothrow_swappable_with: type_traits_swappable_detail::is_nothrow_swappable_with_helper<T, U>::type
|
||||
template<class T, class U> struct is_nothrow_swappable_with: boost_type_traits_swappable_detail::is_nothrow_swappable_with_helper<T, U>::type
|
||||
{
|
||||
};
|
||||
|
||||
template<class T> struct is_nothrow_swappable: type_traits_swappable_detail::is_nothrow_swappable_helper<T>::type
|
||||
template<class T> struct is_nothrow_swappable: boost_type_traits_swappable_detail::is_nothrow_swappable_helper<T>::type
|
||||
{
|
||||
};
|
||||
|
||||
|
92
include/boost/type_traits/is_swappable.hpp
Normal file
92
include/boost/type_traits/is_swappable.hpp
Normal file
@ -0,0 +1,92 @@
|
||||
#ifndef BOOST_TYPE_TRAITS_IS_SWAPPABLE_HPP_INCLUDED
|
||||
#define BOOST_TYPE_TRAITS_IS_SWAPPABLE_HPP_INCLUDED
|
||||
|
||||
// Copyright 2023 Andrey Semashev
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && \
|
||||
!(defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_CXX_VERSION < 201703L))
|
||||
|
||||
#include <boost/type_traits/detail/is_swappable_cxx_11.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<class T, class U> struct is_swappable_with : boost_type_traits_swappable_detail::is_swappable_with_helper<T, U>::type
|
||||
{
|
||||
};
|
||||
|
||||
template<class T> struct is_swappable : boost_type_traits_swappable_detail::is_swappable_helper<T>::type
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#elif defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_CXX_VERSION < 201703L) && \
|
||||
!defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
|
||||
!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) // these are required for is_constructible and is_assignable
|
||||
|
||||
// MSVC standard library has SFINAE-unfriendly std::swap in C++ modes prior to C++17,
|
||||
// so we have to reproduce the restrictions on std::swap that are in effect in C++17 mode.
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/type_traits/negation.hpp>
|
||||
#include <boost/type_traits/conjunction.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/type_traits/is_assignable.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/detail/is_swappable_cxx_11.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<class T> struct is_swappable
|
||||
: boost::conjunction<
|
||||
boost::negation< boost::is_const<T> >,
|
||||
boost::is_constructible<T, T&&>,
|
||||
boost::is_assignable<T&, T&&>
|
||||
>::type {};
|
||||
|
||||
template<> struct is_swappable<void> : false_type {};
|
||||
template<> struct is_swappable<const void> : false_type {};
|
||||
template<> struct is_swappable<volatile void> : false_type {};
|
||||
template<> struct is_swappable<const volatile void> : false_type {};
|
||||
template<class T> struct is_swappable<T[]> : false_type {};
|
||||
template<class T> struct is_swappable<T(&)[]> : false_type {};
|
||||
template<class T, std::size_t N> struct is_swappable<T[N]> : is_swappable<T> {};
|
||||
template<class T, std::size_t N> struct is_swappable<T(&)[N]> : is_swappable<T> {};
|
||||
|
||||
template<class T, class U> struct is_swappable_with : boost_type_traits_swappable_detail::is_swappable_with_helper<T, U>::type
|
||||
{
|
||||
};
|
||||
|
||||
template<class T> struct is_swappable_with<T, T> : is_swappable<T> {};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<class T> struct is_swappable : boost::is_scalar<T> {};
|
||||
template<class T> struct is_swappable<const T> : false_type {};
|
||||
|
||||
template<class T, class U> struct is_swappable_with : false_type {};
|
||||
template<class T> struct is_swappable_with<T, T> : is_swappable<T> {};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_TYPE_TRAITS_IS_SWAPPABLE_HPP_INCLUDED
|
@ -1,21 +1,21 @@
|
||||
# copyright John Maddock 2004
|
||||
# Use, modification and distribution are subject to the
|
||||
# Boost Software License, Version 1.0. (See accompanying file
|
||||
# Use, modification and distribution are subject to 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)
|
||||
|
||||
# bring in the rules for testing
|
||||
import testing ;
|
||||
import os ;
|
||||
|
||||
if [ os.environ CI ]
|
||||
if [ os.environ CI ]
|
||||
{
|
||||
CI_DEFINES = <define>CI_SUPPRESS_KNOWN_ISSUES=1 ;
|
||||
CI_DEFINES = <define>CI_SUPPRESS_KNOWN_ISSUES=1 ;
|
||||
}
|
||||
|
||||
|
||||
# type_traits in V1 seem to have two modes: standalone, triggered
|
||||
# by a command line option, and a regular. For now, just imitate
|
||||
# regular
|
||||
# regular
|
||||
|
||||
project : requirements
|
||||
# default to all warnings on:
|
||||
@ -32,7 +32,7 @@ project : requirements
|
||||
<toolset>msvc:<warnings-as-errors>on
|
||||
<include>libs/tt2/light/include
|
||||
$(CI_DEFINES)
|
||||
;
|
||||
;
|
||||
|
||||
rule all-tests {
|
||||
local result ;
|
||||
@ -51,9 +51,9 @@ rule all-tests {
|
||||
{
|
||||
result += [ run $(source).cpp : : : <define>BOOST_TT_DISABLE_INTRINSICS : $(source)_no_intrinsics ] ;
|
||||
}
|
||||
return $(result) ;
|
||||
return $(result) ;
|
||||
}
|
||||
|
||||
|
||||
test-suite type_traits : [ all-tests ] ;
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "test.hpp"
|
||||
#include "check_integral_constant.hpp"
|
||||
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#include <stdfloat>
|
||||
#endif
|
||||
|
||||
TT_TEST_BEGIN(is_arithmetic)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<bool>::value, true);
|
||||
@ -159,6 +163,38 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<boost::uint128_type>::value, t
|
||||
#ifdef BOOST_HAS_FLOAT128
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<boost::float128_type>::value, true);
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#if defined(__STDCPP_FLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<volatile std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const volatile std::float16_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT32_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT64_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT128_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<volatile std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const volatile std::float128_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_BFLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<volatile std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const volatile std::bfloat16_t>::value, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "test.hpp"
|
||||
#include "check_integral_constant.hpp"
|
||||
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#include <stdfloat>
|
||||
#endif
|
||||
|
||||
TT_TEST_BEGIN(is_floating_point)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<float>::value, true);
|
||||
@ -35,6 +39,38 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const __float128>::value,
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<volatile __float128>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const volatile __float128>::value, true);
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#if defined(__STDCPP_FLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<volatile std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const volatile std::float16_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT32_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT64_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT128_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<volatile std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const volatile std::float128_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_BFLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<volatile std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<const volatile std::bfloat16_t>::value, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// cases that should not be true:
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "test.hpp"
|
||||
#include "check_integral_constant.hpp"
|
||||
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#include <stdfloat>
|
||||
#endif
|
||||
|
||||
TT_TEST_BEGIN(is_fundamental)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<void>::value, true);
|
||||
@ -164,6 +168,38 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<boost::uint128_type>::value,
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<boost::float128_type>::value, true);
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#if defined(__STDCPP_FLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<volatile std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const volatile std::float16_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT32_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT64_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT128_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<volatile std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const volatile std::float128_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_BFLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<volatile std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const volatile std::bfloat16_t>::value, true);
|
||||
#endif
|
||||
#endif
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
// Copyright 2017 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
@ -17,6 +16,12 @@
|
||||
#include "check_integral_constant.hpp"
|
||||
#include <utility>
|
||||
|
||||
// These conditions should be similar to those in is_nothrow_swappable.hpp
|
||||
#if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) \
|
||||
|| (defined(__GLIBCXX__) && __GLIBCXX__ <= 20120301) // built-in clang++ -std=c++11 on Travis, w/ libstdc++ 4.6
|
||||
#define BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_EMULATED
|
||||
#endif
|
||||
|
||||
struct X
|
||||
{
|
||||
};
|
||||
@ -45,6 +50,44 @@ struct U
|
||||
|
||||
void swap(U&, U&) {}
|
||||
|
||||
#if !defined(BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_EMULATED) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
|
||||
namespace test_ns {
|
||||
|
||||
// Not swappable using std::swap, but swappable using test_ns::swap
|
||||
struct only_adl_swappable
|
||||
{
|
||||
only_adl_swappable(only_adl_swappable const&) = delete;
|
||||
only_adl_swappable& operator= (only_adl_swappable const&) = delete;
|
||||
};
|
||||
|
||||
inline void swap(only_adl_swappable&, only_adl_swappable&) BOOST_NOEXCEPT {}
|
||||
|
||||
} // namespace test_ns
|
||||
|
||||
namespace boost {
|
||||
namespace type_traits_is_nothrow_swappable_test {
|
||||
|
||||
// Some type that is defined within boost namespace and that has a specialized swap overload
|
||||
struct swappable
|
||||
{
|
||||
swappable(swappable const&) = delete;
|
||||
swappable& operator= (swappable const&) = delete;
|
||||
};
|
||||
|
||||
// This overload should be selected by is_nothrow_swappable
|
||||
inline void swap(swappable&, swappable&) BOOST_NOEXCEPT {}
|
||||
|
||||
} // namespace type_traits_is_nothrow_swappable_test
|
||||
|
||||
// Some generic swap implementation, such as the one from Boost.Swap. This overload should *not* be selected by is_nothrow_swappable.
|
||||
template< typename T1, typename T2 >
|
||||
inline void swap(T1&, T2&) {}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
TT_TEST_BEGIN(is_nothrow_swappable)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<int>::value, true);
|
||||
@ -52,9 +95,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<int const>::value, fals
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<int volatile>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<int const volatile>::value, false);
|
||||
|
||||
#if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) \
|
||||
|| BOOST_WORKAROUND(BOOST_GCC, < 40700)\
|
||||
|| (defined(__GLIBCXX__) && __GLIBCXX__ <= 20120301) // built-in clang++ -std=c++11 on Travis, w/ libstdc++ 4.6
|
||||
#if defined(BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_EMULATED)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<int[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<int const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<int volatile[2]>::value, false);
|
||||
@ -71,9 +112,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<void const>::value, fal
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<void volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<void const volatile>::value, false);
|
||||
|
||||
#if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) \
|
||||
|| BOOST_WORKAROUND(BOOST_GCC, < 40700)\
|
||||
|| (defined(__GLIBCXX__) && __GLIBCXX__ <= 20120301) // built-in clang++ -std=c++11 on Travis, w/ libstdc++ 4.6
|
||||
#if defined(BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_EMULATED)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<X>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<X const>::value, false);
|
||||
@ -157,6 +196,30 @@ BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_nothrow_swappable<std::pair<V, int> cons
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_nothrow_swappable<std::pair<V, int> volatile>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_nothrow_swappable<std::pair<V, int> const volatile>::value), false);
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<test_ns::only_adl_swappable>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<test_ns::only_adl_swappable const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<test_ns::only_adl_swappable volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<test_ns::only_adl_swappable const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<test_ns::only_adl_swappable[2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<test_ns::only_adl_swappable const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<test_ns::only_adl_swappable volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<test_ns::only_adl_swappable const volatile[2]>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<boost::type_traits_is_nothrow_swappable_test::swappable>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<boost::type_traits_is_nothrow_swappable_test::swappable const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<boost::type_traits_is_nothrow_swappable_test::swappable volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<boost::type_traits_is_nothrow_swappable_test::swappable const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<boost::type_traits_is_nothrow_swappable_test::swappable[2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<boost::type_traits_is_nothrow_swappable_test::swappable const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<boost::type_traits_is_nothrow_swappable_test::swappable volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_swappable<boost::type_traits_is_nothrow_swappable_test::swappable const volatile[2]>::value, false);
|
||||
|
||||
#endif // !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "test.hpp"
|
||||
#include "check_integral_constant.hpp"
|
||||
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#include <stdfloat>
|
||||
#endif
|
||||
|
||||
TT_TEST_BEGIN(is_pod)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<bool>::value, true);
|
||||
@ -186,12 +190,38 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<boost::uint128_type>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<boost::float128_type>::value, true);
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#if defined(__STDCPP_FLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<volatile std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const volatile std::float16_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT32_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT64_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT128_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<volatile std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const volatile std::float128_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_BFLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<volatile std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<const volatile std::bfloat16_t>::value, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "test.hpp"
|
||||
#include "check_integral_constant.hpp"
|
||||
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#include <stdfloat>
|
||||
#endif
|
||||
|
||||
TT_TEST_BEGIN(is_scalar)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<bool>::value, true);
|
||||
@ -165,13 +169,39 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<boost::uint128_type>::value, true)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<boost::float128_type>::value, true);
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_CXX23_HDR_STDFLOAT
|
||||
#if defined(__STDCPP_FLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<volatile std::float16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const volatile std::float16_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT32_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT64_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<volatile std::float32_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const volatile std::float32_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_FLOAT128_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<volatile std::float128_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const volatile std::float128_t>::value, true);
|
||||
#endif
|
||||
#if defined(__STDCPP_BFLOAT16_T__)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<volatile std::bfloat16_t>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<const volatile std::bfloat16_t>::value, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
231
test/is_swappable_test.cpp
Normal file
231
test/is_swappable_test.cpp
Normal file
@ -0,0 +1,231 @@
|
||||
// Copyright 2023 Andrey Semashev
|
||||
//
|
||||
// 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
|
||||
|
||||
#ifdef TEST_STD
|
||||
# include <type_traits>
|
||||
#else
|
||||
# include <boost/type_traits/is_swappable.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include "test.hpp"
|
||||
#include "check_integral_constant.hpp"
|
||||
#include <utility>
|
||||
|
||||
// These conditions should be similar to those in is_swappable.hpp
|
||||
#if defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_CXX_VERSION < 201703L) && \
|
||||
!defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
|
||||
!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) // these are required for is_constructible and is_assignable
|
||||
#define BOOST_TYPE_TRAITS_IS_SWAPPABLE_MSVC_EMULATED
|
||||
#elif defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
#define BOOST_TYPE_TRAITS_IS_SWAPPABLE_CXX03_EMULATED
|
||||
#endif
|
||||
|
||||
struct X
|
||||
{
|
||||
};
|
||||
|
||||
struct Y
|
||||
{
|
||||
Y( Y const& ) {}
|
||||
};
|
||||
|
||||
struct Z
|
||||
{
|
||||
Z& operator=( Z const& ) { return *this; }
|
||||
};
|
||||
|
||||
struct U
|
||||
{
|
||||
};
|
||||
|
||||
void swap(U&, U&) {}
|
||||
|
||||
#if !defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_CXX03_EMULATED) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
|
||||
struct not_swappable
|
||||
{
|
||||
not_swappable(not_swappable const&) = delete;
|
||||
not_swappable& operator= (not_swappable const&) = delete;
|
||||
};
|
||||
|
||||
namespace test_ns {
|
||||
|
||||
// Not swappable using std::swap, but swappable using test_ns::swap
|
||||
struct only_adl_swappable
|
||||
{
|
||||
only_adl_swappable(only_adl_swappable const&) = delete;
|
||||
only_adl_swappable& operator= (only_adl_swappable const&) = delete;
|
||||
};
|
||||
|
||||
inline void swap(only_adl_swappable&, only_adl_swappable&) BOOST_NOEXCEPT {}
|
||||
|
||||
} // namespace test_ns
|
||||
|
||||
#endif
|
||||
|
||||
TT_TEST_BEGIN(is_swappable)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int volatile>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int const volatile>::value, false);
|
||||
|
||||
#if defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_CXX03_EMULATED)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int const volatile[2]>::value, false);
|
||||
#else
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int[2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int volatile[2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<int const volatile[2]>::value, false);
|
||||
#endif
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<void>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<void const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<void volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<void const volatile>::value, false);
|
||||
|
||||
#if defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_CXX03_EMULATED)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X const volatile[2]>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y const volatile[2]>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z const volatile[2]>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<U>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<U const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<U volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<U const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<X, int> >::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<X, int> const>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<X, int> volatile>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<X, int> const volatile>::value), false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<Y, int> >::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<Y, int> const>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<Y, int> volatile>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<Y, int> const volatile>::value), false);
|
||||
|
||||
#else // defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_CXX03_EMULATED)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X[2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<X const volatile[2]>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y[2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Y const volatile[2]>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z[2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<Z const volatile[2]>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<U>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<U const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<U volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<U const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<X, int> >::value), true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<X, int> const>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<X, int> volatile>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<X, int> const volatile>::value), false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<Y, int> >::value), true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<Y, int> const>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<Y, int> volatile>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_swappable<std::pair<Y, int> const volatile>::value), false);
|
||||
|
||||
#endif // defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_CXX03_EMULATED)
|
||||
|
||||
#if !defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_CXX03_EMULATED) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<not_swappable>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<not_swappable const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<not_swappable volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<not_swappable const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<not_swappable[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<not_swappable const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<not_swappable volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<not_swappable const volatile[2]>::value, false);
|
||||
|
||||
#if !defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_MSVC_EMULATED)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable[2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable const volatile[2]>::value, false);
|
||||
|
||||
#else // !defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_MSVC_EMULATED)
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable const>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable volatile>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable const volatile>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable const[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable volatile[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_swappable<test_ns::only_adl_swappable const volatile[2]>::value, false);
|
||||
|
||||
#endif // !defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_MSVC_EMULATED)
|
||||
|
||||
#endif // !defined(BOOST_TYPE_TRAITS_IS_SWAPPABLE_CXX03_EMULATED) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
|
||||
TT_TEST_END
|
Reference in New Issue
Block a user