forked from boostorg/type_traits
459
.travis.yml
Normal file
459
.travis.yml
Normal file
@ -0,0 +1,459 @@
|
||||
# Copyright 2016, 2017 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
python: "2.7"
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- BOGUS_JOB=true
|
||||
|
||||
matrix:
|
||||
|
||||
exclude:
|
||||
- env: BOGUS_JOB=true
|
||||
|
||||
include:
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=c++03
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.5
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.5
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.6
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.6
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++14
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.9
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.9
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++14
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.9
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.9
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
|
||||
osx_image: xcode8.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
||||
osx_image: xcode8.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14
|
||||
osx_image: xcode8.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z
|
||||
osx_image: xcode8.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
|
||||
osx_image: xcode8.2
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
||||
osx_image: xcode8.2
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14
|
||||
osx_image: xcode8.2
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z
|
||||
osx_image: xcode8.1
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
|
||||
osx_image: xcode8.1
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
||||
osx_image: xcode8.1
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14
|
||||
osx_image: xcode8.1
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z
|
||||
osx_image: xcode8.1
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
|
||||
osx_image: xcode8.0
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
||||
osx_image: xcode8.0
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14
|
||||
osx_image: xcode8.0
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z
|
||||
osx_image: xcode8.0
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
|
||||
osx_image: xcode7.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
||||
osx_image: xcode7.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14
|
||||
osx_image: xcode7.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z
|
||||
osx_image: xcode7.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
|
||||
osx_image: xcode6.4
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
||||
osx_image: xcode6.4
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14
|
||||
osx_image: xcode6.4
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z
|
||||
osx_image: xcode6.4
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init libs/assert
|
||||
- git submodule update --init libs/bind
|
||||
- git submodule update --init libs/core
|
||||
- git submodule update --init libs/detail
|
||||
- git submodule update --init libs/function
|
||||
- git submodule update --init libs/integer
|
||||
- git submodule update --init libs/move
|
||||
- git submodule update --init libs/mpl
|
||||
- git submodule update --init libs/preprocessor
|
||||
- git submodule update --init libs/static_assert
|
||||
- git submodule update --init libs/throw_exception
|
||||
- git submodule update --init libs/type_index
|
||||
- git submodule update --init libs/utility
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/type_traits
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
||||
script:
|
||||
- |-
|
||||
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
|
||||
- (cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET && ./config_info_travis)
|
||||
- ./b2 -j3 libs/type_traits/test toolset=$TOOLSET
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: always
|
74
appveyor.yml
Normal file
74
appveyor.yml
Normal file
@ -0,0 +1,74 @@
|
||||
# Copyright 2016 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
version: 1.0.{build}-{branch}
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
platform:
|
||||
- x64
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- ARGS: --toolset=msvc-9.0 address-model=32
|
||||
- ARGS: --toolset=msvc-10.0 address-model=32
|
||||
- ARGS: --toolset=msvc-11.0 address-model=32
|
||||
- ARGS: --toolset=msvc-12.0 address-model=32
|
||||
- ARGS: --toolset=msvc-14.0 address-model=32
|
||||
- ARGS: --toolset=msvc-12.0 address-model=64
|
||||
- ARGS: --toolset=msvc-14.0 address-model=64
|
||||
- ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ARGS: --toolset=msvc-14.1 address-model=64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ARGS: --toolset=msvc-14.1 address-model=32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest
|
||||
- ARGS: --toolset=gcc address-model=64
|
||||
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
|
||||
- ARGS: --toolset=gcc address-model=64 cxxflags=-std=gnu++1z
|
||||
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
|
||||
- ARGS: --toolset=gcc address-model=32
|
||||
PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
|
||||
- ARGS: --toolset=gcc address-model=32 linkflags=-Wl,-allow-multiple-definition
|
||||
PATH: C:\MinGW\bin;%PATH%
|
||||
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init libs/assert
|
||||
- git submodule update --init libs/bind
|
||||
- git submodule update --init libs/core
|
||||
- git submodule update --init libs/detail
|
||||
- git submodule update --init libs/function
|
||||
- git submodule update --init libs/integer
|
||||
- git submodule update --init libs/move
|
||||
- git submodule update --init libs/mpl
|
||||
- git submodule update --init libs/preprocessor
|
||||
- git submodule update --init libs/static_assert
|
||||
- git submodule update --init libs/throw_exception
|
||||
- git submodule update --init libs/type_index
|
||||
- git submodule update --init libs/utility
|
||||
- git submodule update --init libs/functional
|
||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\type_traits
|
||||
- bootstrap
|
||||
- b2 headers
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- cd libs\config\test
|
||||
- ..\..\..\b2 config_info_travis_install %ARGS%
|
||||
- config_info_travis
|
||||
- cd ..\..\type_traits\test
|
||||
- ..\..\..\b2 -j3 %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_const_t = typename add_const<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T const` for all `T`.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_cv_t = typename add_cv<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T const volatile` for all `T`.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_lvalue_reference_t = typename add_lvalue_reference<T>::type; // C++11 and above
|
||||
|
||||
__type If `T` names an object or function type then the member typedef `type`
|
||||
shall name `T&`; otherwise, if `T` names a type ['rvalue reference to U] then
|
||||
the member typedef type shall name `U&`; otherwise, type shall name `T`.
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_pointer_t = typename add_pointer<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `remove_reference<T>::type*`.
|
||||
|
||||
The rationale for this template
|
||||
|
@ -18,6 +18,8 @@ for backwards compatibility only.
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
template <class T> using add_reference_t = typename add_reference<T>::type; // C++11 and above
|
||||
|
||||
__type If `T` is not a reference type then `T&`, otherwise `T`.
|
||||
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; // C++11 and above
|
||||
|
||||
__type If `T` names an object or function type then the member typedef type
|
||||
shall name `T&&`; otherwise, type shall name `T`. ['\[Note: This rule reflects
|
||||
the semantics of reference collapsing. For example, when a type `T` names
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_volatile_t = typename add_volatile<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T volatile` for all `T`.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
@ -15,6 +15,7 @@ __header ` #include <boost/type_traits/common_type.hpp>` or ` #include <boost/ty
|
||||
|
||||
namespace boost {
|
||||
template <class... T> struct common_type;
|
||||
template<class... T> using common_type_t = typename common_type<T...>::type; // C++11 and above
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,6 +14,7 @@ __header ` #include <boost/type_traits/conditional.hpp>` or ` #include <boost/ty
|
||||
|
||||
namespace boost {
|
||||
template <bool B, class T, class U> struct __conditional;
|
||||
template <bool B, class T, class U> using conditional_t = typename conditional<B, T, U>::type; // C++11 and above
|
||||
}
|
||||
|
||||
If B is true, the member typedef type shall equal T. If B is false, the member typedef type shall equal U.
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T, class U> using copy_cv_t = typename copy_cv<T, U>::type; // C++11 and above
|
||||
|
||||
__type [^T /cv/], where /cv/ are the cv-qualifiers of `U`.
|
||||
|
||||
__header ` #include <boost/type_traits/copy_cv.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using decay_t = typename decay<T>::type; // C++11 and above
|
||||
|
||||
__type Let `U` be the result of `remove_reference<T>::type`, then if `U` is
|
||||
an array type, the result is `remove_extent<U>::type*`, otherwise if `U` is a
|
||||
function type then the result is `U*`, otherwise the result is `U`.
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using floating_point_promotion_t = typename floating_point_promotion<T>::type; // C++11 and above
|
||||
|
||||
__type If floating point promotion can be applied to an rvalue of type `T`,
|
||||
then applies floating point promotion to `T` and keeps cv-qualifiers of `T`,
|
||||
otherwise leaves `T` unchanged.
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">add_const_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">add_const</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">T</span>
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">add_cv_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">add_cv</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">T</span>
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">add_lvalue_reference_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">add_lvalue_reference</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If <code class="computeroutput"><span class="identifier">T</span></code>
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">add_pointer_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">add_pointer</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">remove_reference</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">*</span></code>.
|
||||
|
@ -43,6 +43,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">add_reference_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">add_reference</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If <code class="computeroutput"><span class="identifier">T</span></code>
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">add_rvalue_reference_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">add_rvalue_reference</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If <code class="computeroutput"><span class="identifier">T</span></code>
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">add_volatile_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">add_volatile</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">T</span>
|
||||
|
@ -33,6 +33,7 @@
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special">;</span>
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">common_type_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">T</span><span class="special">...>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
<span class="special">}</span>
|
||||
</pre>
|
||||
<p>
|
||||
|
@ -33,6 +33,7 @@
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">bool</span> <span class="identifier">B</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="conditional.html" title="conditional">conditional</a><span class="special">;</span>
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">bool</span> <span class="identifier">B</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">conditional_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">conditional</span><span class="special"><</span><span class="identifier">B</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
<span class="special">}</span>
|
||||
</pre>
|
||||
<p>
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">copy_cv_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">copy_cv</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> <code class="literal">T <span class="emphasis"><em>cv</em></span></code>,
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">decay_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">decay</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> Let <code class="computeroutput"><span class="identifier">U</span></code>
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">floating_point_promotion_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">floating_point_promotion</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If floating point promotion can be
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">integral_promotion_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">integral_promotion</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If integral promotion can be applied
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">make_signed_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">make_signed</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If T is a signed integer type then
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">make_unsigned_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">make_unsigned</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If T is a unsigned integer type then
|
||||
|
179
doc/html/boost_typetraits/reference/make_void.html
Normal file
179
doc/html/boost_typetraits/reference/make_void.html
Normal file
@ -0,0 +1,179 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>make_void</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="make_unsigned.html" title="make_unsigned">
|
||||
<link rel="next" href="promote.html" title="promote">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_unsigned.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="promote.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.make_void"></a><a class="link" href="make_void.html" title="make_void">make_void</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">make_void</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <span class="keyword">void</span> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">Ts</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">void_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">make_void</span><span class="special"><</span><span class="identifier">Ts</span><span class="special">...>::</span><span class="identifier">type</span><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The type <code class="computeroutput"><span class="keyword">void</span></code>
|
||||
for all <code class="computeroutput"><span class="identifier">T</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"> <span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">make_void</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.make_void.examples"></a><p class="title"><b>Table 1.25. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Expression
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
Result Type
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">make_void</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">type</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">make_void</span><span class="special"><</span><span class="keyword">int</span><span class="special">&>::</span><span class="identifier">type</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">make_void</span><span class="special"><</span><span class="keyword">int</span><span class="special">(*)(</span><span class="keyword">int</span><span class="special">)>::</span><span class="identifier">type</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">make_void</span><span class="special"><</span><span class="keyword">int</span><span class="special">[]>::</span><span class="identifier">type</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">make_void</span><span class="special"><</span><span class="keyword">int</span><span class="special">[</span><span class="number">1</span><span class="special">]>::</span><span class="identifier">type</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">make_void</span><span class="special"><>::</span><span class="identifier">type</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">make_void</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>::</span><span class="identifier">type</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="keyword">void</span></code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
<br class="table-break"><p>
|
||||
<span class="bold"><strong>Compiler Compatibility:</strong></span> All current compilers
|
||||
are supported by this trait. However, the type alias <code class="computeroutput"><span class="identifier">void_t</span></code>
|
||||
is only available if the compiler supports template aliases. Further, in
|
||||
the absence of variadic-template support, <code class="computeroutput"><span class="identifier">make_void</span></code>
|
||||
only supports up to 5 parameters.
|
||||
</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_unsigned.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="promote.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">promote_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">promote</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If integral or floating point promotion
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">remove_all_extents_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">remove_all_extents</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If <code class="computeroutput"><span class="identifier">T</span></code>
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">remove_const_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">remove_const</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">T</span></code>,
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">remove_cv_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">remove_cv</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">T</span></code>,
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">remove_extent_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">remove_extent</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> If <code class="computeroutput"><span class="identifier">T</span></code>
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">remove_pointer_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">remove_pointer</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">T</span></code>,
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">remove_reference_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">remove_reference</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">T</span></code>,
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">remove_volatile_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">remove_volatile</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">T</span></code>,
|
||||
|
@ -31,6 +31,8 @@
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <span class="identifier">T</span> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">using</span> <span class="identifier">type_identity_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">type_identity</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"> <span class="preprocessor">#include</span>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1088135"></a>Class Index</h2></div></div></div>
|
||||
<a name="id1101825"></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="id1092954"></a>Typedef Index</h2></div></div></div>
|
||||
<a name="id1105376"></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="id1093170"></a>Macro Index</h2></div></div></div>
|
||||
<a name="id1105605"></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="id1093820"></a>Index</h2></div></div></div>
|
||||
<a name="id1106284"></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>
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using integral_promotion_t = typename integral_promotion<T>::type; // C++11 and above
|
||||
|
||||
__type If integral promotion can be applied to an rvalue of type `T`, then
|
||||
applies integral promotion to `T` and keeps cv-qualifiers of `T`,
|
||||
otherwise leaves `T` unchanged.
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using make_signed_t = typename make_signed<T>::type; // C++11 and above
|
||||
|
||||
__type If T is a signed integer type then the same type as T, if T is an
|
||||
unsigned integer type then the corresponding signed type.
|
||||
Otherwise if T is an enumerated or
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using make_unsigned_t = typename make_unsigned<T>::type; // C++11 and above
|
||||
|
||||
__type If T is a unsigned integer type then the same type as T, if T is an
|
||||
signed integer type then the corresponding unsigned type.
|
||||
Otherwise if T is an enumerated or
|
||||
|
@ -13,6 +13,8 @@
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
template <class T> using promote_t = typename promote<T>::type; // C++11 and above
|
||||
|
||||
__type If integral or floating point promotion can be applied to an rvalue
|
||||
of type `T`, then applies integral and floating point promotions to `T` and
|
||||
keeps cv-qualifiers of `T`, otherwise leaves `T` unchanged. See also
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_all_extents_t = typename remove_all_extents<T>::type; // C++11 and above
|
||||
|
||||
__type If `T` is an array type, then removes all of the array bounds on `T`, otherwise
|
||||
leaves `T` unchanged.
|
||||
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_const_t = typename remove_const<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any /top level/ const-qualifier removed.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_cv_t = typename remove_cv<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any /top level/ cv-qualifiers removed.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
44
doc/remove_cv_ref.qbk
Normal file
44
doc/remove_cv_ref.qbk
Normal file
@ -0,0 +1,44 @@
|
||||
[/
|
||||
Copyright 2007 John Maddock.
|
||||
Copyright 2017 Peter Dimov.
|
||||
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:remove_cv_ref remove_cv_ref]
|
||||
|
||||
template <class T>
|
||||
struct remove_cv_ref
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
template <class T> using remove_cv_ref_t = typename remove_cv_ref<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any reference modifiers and /top level/ cv-qualifiers removed.
|
||||
|
||||
__std_ref 3.9.3, 8.3.2.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/remove_cv_ref.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
[table Examples
|
||||
|
||||
[ [Expression] [Result Type]]
|
||||
|
||||
[[`remove_cv_ref<int>::type`][`int`]]
|
||||
|
||||
[[`remove_cv_ref<int const>::type`] [`int`]]
|
||||
|
||||
[[`remove_cv_ref<int const volatile>::type`] [`int`]]
|
||||
|
||||
[[`remove_cv_ref<int const&>::type`] [`int`]]
|
||||
|
||||
[[`remove_cv_ref<int const*>::type`] [`int const*`]]
|
||||
|
||||
]
|
||||
|
||||
[endsect]
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_extent_t = typename remove_extent<T>::type; // C++11 and above
|
||||
|
||||
__type If `T` is an array type, then removes the topmost array bound,
|
||||
otherwise leaves `T` unchanged.
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
template <class T> using remove_pointer_t = typename remove_pointer<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any pointer modifier removed. Note that pointers to members are left unchanged:
|
||||
removing the pointer decoration would result in an invalid type.
|
||||
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_reference_t = typename remove_reference<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any reference modifier removed.
|
||||
|
||||
__std_ref 8.3.2.
|
||||
|
@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_volatile_t = typename remove_volatile<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any /top level/ volatile-qualifier removed.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
@ -12,6 +12,8 @@
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template <class T> using type_identity_t = typename type_identity<T>::type; // C++11 and above
|
||||
|
||||
__header ` #include <boost/type_traits/type_identity.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -109,6 +109,7 @@
|
||||
[def __remove_const [link boost_typetraits.reference.remove_const remove_const]]
|
||||
[def __remove_volatile [link boost_typetraits.reference.remove_volatile remove_volatile]]
|
||||
[def __remove_cv [link boost_typetraits.reference.remove_cv remove_cv]]
|
||||
[def __remove_cv_ref [link boost_typetraits.reference.remove_cv_ref remove_cv_ref]]
|
||||
[def __remove_reference [link boost_typetraits.reference.remove_reference remove_reference]]
|
||||
[def __remove_extent [link boost_typetraits.reference.remove_extent remove_extent]]
|
||||
[def __remove_all_extents [link boost_typetraits.reference.remove_all_extents remove_all_extents]]
|
||||
@ -325,6 +326,7 @@ See __has_trivial_constructor.
|
||||
[include remove_all_extents.qbk]
|
||||
[include remove_const.qbk]
|
||||
[include remove_cv.qbk]
|
||||
[include remove_cv_ref.qbk]
|
||||
[include remove_extent.qbk]
|
||||
[include remove_pointer.qbk]
|
||||
[include remove_reference.qbk]
|
||||
|
@ -136,6 +136,7 @@
|
||||
#include <boost/type_traits/remove_bounds.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/remove_cv_ref.hpp>
|
||||
#include <boost/type_traits/remove_extent.hpp>
|
||||
#include <boost/type_traits/remove_pointer.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
@ -41,6 +41,12 @@ namespace boost {
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using add_const_t = typename add_const<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_ADD_CONST_HPP_INCLUDED
|
||||
|
@ -36,6 +36,12 @@ template <class T> struct add_cv{ typedef T const volatile type; };
|
||||
|
||||
template <class T> struct add_cv<T&>{ typedef T& type; };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using add_cv_t = typename add_cv<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_ADD_CV_HPP_INCLUDED
|
||||
|
@ -22,6 +22,12 @@ template <class T> struct add_lvalue_reference<T&&>
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using add_lvalue_reference_t = typename add_lvalue_reference<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP
|
||||
|
@ -56,6 +56,12 @@ struct add_pointer
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using add_pointer_t = typename add_pointer<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_ADD_POINTER_HPP_INCLUDED
|
||||
|
@ -54,6 +54,13 @@ template <> struct add_reference<const volatile void> { typedef const volatile v
|
||||
template <> struct add_reference<volatile void> { typedef volatile void type; };
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using add_reference_t = typename add_reference<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
|
||||
|
@ -58,6 +58,12 @@ template <class T> struct add_rvalue_reference
|
||||
typedef typename boost::type_traits_detail::add_rvalue_reference_imp<T>::type type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP
|
||||
|
@ -35,6 +35,12 @@ template <class T> struct add_volatile{ typedef T volatile type; };
|
||||
|
||||
template <class T> struct add_volatile<T&>{ typedef T& type; };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using add_volatile_t = typename add_volatile<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
|
||||
|
@ -14,6 +14,12 @@ namespace boost {
|
||||
template <bool b, class T, class U> struct conditional { typedef T type; };
|
||||
template <class T, class U> struct conditional<false, T, U> { typedef U type; };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <bool b, class T, class U> using conditional_t = typename conditional<b, T, U>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
|
@ -29,6 +29,12 @@ public:
|
||||
typedef typename boost::conditional<boost::is_volatile<U>::value, typename boost::add_volatile<CT>::type, CT>::type type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T, class U> using copy_cv_t = typename copy_cv<T, U>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED
|
||||
|
@ -37,6 +37,12 @@ namespace boost
|
||||
typedef typename boost::detail::decay_imp<Ty, boost::is_array<Ty>::value, boost::is_function<Ty>::value>::type type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using decay_t = typename decay<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
|
@ -14,6 +14,12 @@ namespace boost {
|
||||
template<> struct floating_point_promotion<float volatile>{ typedef double volatile type; };
|
||||
template<> struct floating_point_promotion<float const volatile> { typedef double const volatile type; };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using floating_point_promotion_t = typename floating_point_promotion<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED
|
||||
|
@ -175,6 +175,12 @@ public:
|
||||
typedef typename boost::type_traits::detail::integral_promotion<T, tag_type::value>::type type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using integral_promotion_t = typename integral_promotion<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED
|
||||
|
@ -125,6 +125,12 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using make_signed_t = typename make_signed<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
|
||||
|
@ -124,6 +124,12 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using make_unsigned_t = typename make_unsigned<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
|
||||
|
@ -14,6 +14,12 @@ namespace boost {
|
||||
|
||||
template<class T> struct promote : public integral_promotion<typename floating_point_promotion<T>::type>{};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using promote_t = typename promote<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // #ifndef FILE_boost_type_traits_promote_hpp_INCLUDED
|
||||
|
@ -30,6 +30,12 @@ template <class T> struct remove_all_extents<T const volatile[]> : public remove
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_all_extents_t = typename remove_all_extents<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
|
||||
|
@ -16,6 +16,13 @@ namespace boost
|
||||
|
||||
template <class T> struct remove_bounds : public remove_extent<T> {};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_bounds_t = typename remove_bounds<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
|
||||
|
@ -28,6 +28,12 @@ namespace boost {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_const_t = typename remove_const<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_REMOVE_CONST_HPP_INCLUDED
|
||||
|
@ -34,6 +34,11 @@ template <class T> struct remove_cv<T volatile[]>{ typedef T type[]; };
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_cv_t = typename remove_cv<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
30
include/boost/type_traits/remove_cv_ref.hpp
Normal file
30
include/boost/type_traits/remove_cv_ref.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
// (C) Copyright Peter Dimov 2017.
|
||||
// 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).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
|
||||
#ifndef BOOST_TT_REMOVE_CV_REF_HPP_INCLUDED
|
||||
#define BOOST_TT_REMOVE_CV_REF_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct remove_cv_ref: remove_cv<typename remove_reference<T>::type> {};
|
||||
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_cv_ref_t = typename remove_cv_ref<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_REMOVE_CV_REF_HPP_INCLUDED
|
@ -30,6 +30,12 @@ template <typename T> struct remove_extent<T const volatile[]> { typedef T const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_extent_t = typename remove_extent<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
|
||||
|
@ -72,6 +72,12 @@ template <class T> struct remove_pointer<T*const volatile>{ typedef T type; };
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_pointer_t = typename remove_pointer<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
|
||||
|
@ -48,6 +48,11 @@ template <class T> struct remove_reference<T&volatile>{ typedef T type; };
|
||||
template <class T> struct remove_reference<T&const volatile>{ typedef T type; };
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_reference_t = typename remove_reference<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
@ -28,6 +28,11 @@ namespace boost {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_volatile_t = typename remove_volatile<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
@ -17,6 +17,13 @@ template<class T> struct type_identity
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using type_identity_t = typename type_identity<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED
|
||||
|
@ -35,7 +35,14 @@ template <class T>
|
||||
void do_check(const T&)
|
||||
{
|
||||
typedef typename tt::aligned_storage<T::value,T::value>::type t1;
|
||||
#if defined(BOOST_GCC) && (BOOST_GCC < 40800)
|
||||
// In order to test this with warnings-as-errors with GCC, we need
|
||||
// a slightly different initializer here to suppress spurious
|
||||
// GCC warnings (ie to work around a GCC buglet).
|
||||
t1 as1 = {{{ 0, }}};
|
||||
#else
|
||||
t1 as1 = { 0, };
|
||||
#endif
|
||||
must_be_pod<t1> pod1;
|
||||
no_unused_warning(as1);
|
||||
no_unused_warning(pod1);
|
||||
@ -46,7 +53,11 @@ void do_check(const T&)
|
||||
BOOST_CHECK(::tt::is_pod<t1>::value == true);
|
||||
#endif
|
||||
typedef typename tt::aligned_storage<T::value*2,T::value>::type t2;
|
||||
#if defined(BOOST_GCC) && (BOOST_GCC < 40800)
|
||||
t2 as2 = {{{ 0, }}};
|
||||
#else
|
||||
t2 as2 = { 0, };
|
||||
#endif
|
||||
must_be_pod<t2> pod2;
|
||||
no_unused_warning(as2);
|
||||
no_unused_warning(pod2);
|
||||
@ -60,7 +71,11 @@ void do_check(const T&)
|
||||
#ifndef TEST_STD
|
||||
// Non-Tr1 behaviour:
|
||||
typedef typename tt::aligned_storage<T::value,(std::size_t)(-1L)>::type t3;
|
||||
#if defined(BOOST_GCC) && (BOOST_GCC < 40800)
|
||||
t3 as3 = {{{ 0, }}};
|
||||
#else
|
||||
t3 as3 = { 0, };
|
||||
#endif
|
||||
must_be_pod<t3> pod3;
|
||||
no_unused_warning(as3);
|
||||
no_unused_warning(pod3);
|
||||
|
46
test/cxx14_aliases_test.cpp
Normal file
46
test/cxx14_aliases_test.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
// Copyright Peter Dimov 2017
|
||||
// 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.tt.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "test.hpp"
|
||||
#include "check_type.hpp"
|
||||
#ifdef TEST_STD
|
||||
# include <type_traits>
|
||||
#else
|
||||
# include <boost/type_traits.hpp>
|
||||
#endif
|
||||
#include <iostream>
|
||||
|
||||
TT_TEST_BEGIN(cxx14_aliases_test)
|
||||
{
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
BOOST_CHECK_TYPE(tt::add_const_t<int>, int const);
|
||||
BOOST_CHECK_TYPE(tt::add_cv_t<int>, int const volatile);
|
||||
BOOST_CHECK_TYPE(tt::add_lvalue_reference_t<int>, int&);
|
||||
BOOST_CHECK_TYPE(tt::add_pointer_t<int>, int*);
|
||||
BOOST_CHECK_TYPE(tt::add_rvalue_reference_t<int>, int&&);
|
||||
BOOST_CHECK_TYPE(tt::add_volatile_t<int>, int volatile);
|
||||
BOOST_CHECK_TYPE3(tt::common_type_t<char, short>, int);
|
||||
BOOST_CHECK_TYPE4(tt::conditional_t<true, char, short>, char);
|
||||
BOOST_CHECK_TYPE4(tt::conditional_t<false, char, short>, short);
|
||||
BOOST_CHECK_TYPE3(tt::copy_cv_t<char, short const volatile>, char const volatile);
|
||||
BOOST_CHECK_TYPE(tt::decay_t<char const(&)[7]>, char const*);
|
||||
BOOST_CHECK_TYPE(tt::make_signed_t<unsigned char>, signed char);
|
||||
BOOST_CHECK_TYPE(tt::make_unsigned_t<signed char>, unsigned char);
|
||||
BOOST_CHECK_TYPE(tt::remove_all_extents_t<int[][10][20]>, int);
|
||||
BOOST_CHECK_TYPE(tt::remove_const_t<int const>, int);
|
||||
BOOST_CHECK_TYPE(tt::remove_cv_t<int const volatile>, int);
|
||||
BOOST_CHECK_TYPE(tt::remove_extent_t<int[]>, int);
|
||||
BOOST_CHECK_TYPE(tt::remove_pointer_t<int*>, int);
|
||||
BOOST_CHECK_TYPE(tt::remove_reference_t<int&>, int);
|
||||
BOOST_CHECK_TYPE(tt::remove_volatile_t<int volatile>, int);
|
||||
BOOST_CHECK_TYPE(tt::floating_point_promotion_t<float>, double);
|
||||
BOOST_CHECK_TYPE(tt::integral_promotion_t<char>, int);
|
||||
BOOST_CHECK_TYPE(tt::promote_t<char>, int);
|
||||
|
||||
#endif
|
||||
}
|
||||
TT_TEST_END
|
@ -210,7 +210,9 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<bug11324_derived>::v
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<deleted_default_construct>::value, false);
|
||||
#endif
|
||||
#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<private_default_construct>::value, false);
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_NOEXCEPT
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<noexcept_default_construct>::value, true);
|
||||
#endif
|
||||
|
@ -238,8 +238,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<noexcept_copy>::value, true
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<non_copy>::value, false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
@ -198,7 +198,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<bug11324_derived>::
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<deleted_default_construct>::value, false);
|
||||
#endif
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40800)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<private_default_construct>::value, false);
|
||||
#endif
|
||||
|
||||
|
@ -180,9 +180,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<UDT>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<empty_UDT>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<void>::value, false);
|
||||
|
||||
#if !(defined(BOOST_MSVC) && defined(CI_SUPPRESS_KNOWN_ISSUES) && (BOOST_MSVC < 1900))
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<deleted_destruct>::value, false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
@ -5,8 +5,12 @@
|
||||
// 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 "test.hpp"
|
||||
#include "check_integral_constant.hpp"
|
||||
|
||||
#if !(defined(BOOST_MSVC) && defined(BOOST_TT_DISABLE_INTRINSICS) && defined(CI_SUPPRESS_KNOWN_ISSUES))
|
||||
|
||||
#ifdef TEST_STD
|
||||
# include <type_traits>
|
||||
#else
|
||||
@ -216,9 +220,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<int&>::value, fal
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<int&&>::value, false);
|
||||
#endif
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<const int&>::value, false);
|
||||
#if !(defined(BOOST_MSVC) && defined(CI_SUPPRESS_KNOWN_ISSUES) && (BOOST_MSVC < 1910))
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<int[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<int[3][2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<int[2][4][5][6][3]>::value, false);
|
||||
#endif
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<UDT>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<empty_UDT>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<void>::value, false);
|
||||
@ -251,5 +257,9 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<noexcept_move_ass
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
#else
|
||||
|
||||
int main() { return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
#include "test.hpp"
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !(defined(BOOST_MSVC) && defined(BOOST_TT_DISABLE_INTRINSICS) && defined(CI_SUPPRESS_KNOWN_ISSUES))
|
||||
|
||||
#include "check_integral_constant.hpp"
|
||||
#ifdef TEST_STD
|
||||
# include <type_traits>
|
||||
@ -231,8 +234,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<empty_POD_UDT>
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<POD_UDT>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<POD_union_UDT>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<empty_POD_union_UDT>::value, true);
|
||||
#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<nothrow_copy_UDT>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<nothrow_move_UDT>::value, true);
|
||||
#endif
|
||||
#else
|
||||
// cases we would like to succeed but can't implement in the language:
|
||||
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<empty_POD_UDT>::value, true, false);
|
||||
@ -245,7 +250,9 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<nothrow_assign
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<nothrow_construct_UDT>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<test_abc1>::value, false);
|
||||
|
||||
#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<non_copy>::value, false);
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<delete_copy>::value, false);
|
||||
@ -253,10 +260,17 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<delete_copy>::
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<noexcept_copy>::value, true);
|
||||
#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800)
|
||||
// Test fails on gcc 4.7.x:
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<noexcept_move>::value, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
#else
|
||||
|
||||
int main() { return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#pragma warning(disable:1418)
|
||||
#endif
|
||||
|
||||
#if !(defined(BOOST_MSVC) && defined(CI_SUPPRESS_KNOWN_ISSUES))
|
||||
|
||||
enum UIntEnum { UIntEnum_max = UINT_MAX };
|
||||
|
||||
@ -37,6 +38,8 @@ void test_promote_to_uint()
|
||||
test_cv< UIntEnum, unsigned int >();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
|
144
test/remove_cv_ref_test.cpp
Normal file
144
test/remove_cv_ref_test.cpp
Normal file
@ -0,0 +1,144 @@
|
||||
|
||||
// (C) Copyright John Maddock 2000.
|
||||
// (C) Copyright Peter Dimov 2017.
|
||||
// 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.tt.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "test.hpp"
|
||||
#include "check_type.hpp"
|
||||
#ifdef TEST_STD
|
||||
# include <type_traits>
|
||||
#else
|
||||
# include <boost/type_traits/remove_cv_ref.hpp>
|
||||
#endif
|
||||
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_1, ::tt::remove_cv_ref, const)
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_2, ::tt::remove_cv_ref, volatile)
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_3, ::tt::remove_cv_ref, const volatile)
|
||||
BOOST_DECL_TRANSFORM_TEST0(remove_cv_ref_test_4, ::tt::remove_cv_ref)
|
||||
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_5, ::tt::remove_cv_ref, const &)
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_6, ::tt::remove_cv_ref, volatile &)
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_7, ::tt::remove_cv_ref, const volatile &)
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_8, ::tt::remove_cv_ref, &)
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_9, ::tt::remove_cv_ref, const &&)
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_10, ::tt::remove_cv_ref, volatile &&)
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_11, ::tt::remove_cv_ref, const volatile &&)
|
||||
BOOST_DECL_TRANSFORM_TEST3(remove_cv_ref_test_12, ::tt::remove_cv_ref, &&)
|
||||
#endif
|
||||
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_13, ::tt::remove_cv_ref, *const, *)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_14, ::tt::remove_cv_ref, *volatile, *)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_15, ::tt::remove_cv_ref, *const volatile, *)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_16, ::tt::remove_cv_ref, *, *)
|
||||
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_17, ::tt::remove_cv_ref, *const &, *)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_18, ::tt::remove_cv_ref, *volatile &, *)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_19, ::tt::remove_cv_ref, *const volatile &, *)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_20, ::tt::remove_cv_ref, * &, *)
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_21, ::tt::remove_cv_ref, *const &&, *)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_22, ::tt::remove_cv_ref, *volatile &&, *)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_23, ::tt::remove_cv_ref, *const volatile &&, *)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_24, ::tt::remove_cv_ref, * &&, *)
|
||||
#endif
|
||||
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_25, ::tt::remove_cv_ref, const*, const*)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_26, ::tt::remove_cv_ref, volatile*, volatile*)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_27, ::tt::remove_cv_ref, const*const, const*)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_28, ::tt::remove_cv_ref, const*volatile, const*)
|
||||
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_29, ::tt::remove_cv_ref, const* &, const*)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_30, ::tt::remove_cv_ref, volatile* &, volatile*)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_31, ::tt::remove_cv_ref, const*const &, const*)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_32, ::tt::remove_cv_ref, const*volatile &, const*)
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_33, ::tt::remove_cv_ref, const* &&, const*)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_34, ::tt::remove_cv_ref, volatile* &&, volatile*)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_35, ::tt::remove_cv_ref, const*const &&, const*)
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_36, ::tt::remove_cv_ref, const*volatile &&, const*)
|
||||
#endif
|
||||
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_37, ::tt::remove_cv_ref, const[2], [2])
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_38, ::tt::remove_cv_ref, volatile[2], [2])
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_39, ::tt::remove_cv_ref, const volatile[2], [2])
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_40, ::tt::remove_cv_ref, [2], [2])
|
||||
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_41, ::tt::remove_cv_ref, const(&)[2], [2])
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_42, ::tt::remove_cv_ref, volatile(&)[2], [2])
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_43, ::tt::remove_cv_ref, const volatile(&)[2], [2])
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_44, ::tt::remove_cv_ref, (&)[2], [2])
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_45, ::tt::remove_cv_ref, const(&&)[2], [2])
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_46, ::tt::remove_cv_ref, volatile(&&)[2], [2])
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_47, ::tt::remove_cv_ref, const volatile(&&)[2], [2])
|
||||
BOOST_DECL_TRANSFORM_TEST(remove_cv_ref_test_48, ::tt::remove_cv_ref, (&&)[2], [2])
|
||||
#endif
|
||||
|
||||
TT_TEST_BEGIN(remove_cv_ref)
|
||||
|
||||
remove_cv_ref_test_1();
|
||||
remove_cv_ref_test_2();
|
||||
remove_cv_ref_test_3();
|
||||
remove_cv_ref_test_4();
|
||||
remove_cv_ref_test_5();
|
||||
remove_cv_ref_test_6();
|
||||
remove_cv_ref_test_7();
|
||||
remove_cv_ref_test_8();
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
remove_cv_ref_test_9();
|
||||
remove_cv_ref_test_10();
|
||||
remove_cv_ref_test_11();
|
||||
remove_cv_ref_test_12();
|
||||
#endif
|
||||
remove_cv_ref_test_13();
|
||||
remove_cv_ref_test_14();
|
||||
remove_cv_ref_test_15();
|
||||
remove_cv_ref_test_16();
|
||||
remove_cv_ref_test_17();
|
||||
remove_cv_ref_test_18();
|
||||
remove_cv_ref_test_19();
|
||||
remove_cv_ref_test_20();
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
remove_cv_ref_test_21();
|
||||
remove_cv_ref_test_22();
|
||||
remove_cv_ref_test_23();
|
||||
remove_cv_ref_test_24();
|
||||
#endif
|
||||
remove_cv_ref_test_25();
|
||||
remove_cv_ref_test_26();
|
||||
remove_cv_ref_test_27();
|
||||
remove_cv_ref_test_28();
|
||||
remove_cv_ref_test_29();
|
||||
remove_cv_ref_test_30();
|
||||
remove_cv_ref_test_31();
|
||||
remove_cv_ref_test_32();
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
remove_cv_ref_test_33();
|
||||
remove_cv_ref_test_34();
|
||||
remove_cv_ref_test_35();
|
||||
remove_cv_ref_test_36();
|
||||
#endif
|
||||
remove_cv_ref_test_37();
|
||||
remove_cv_ref_test_38();
|
||||
remove_cv_ref_test_39();
|
||||
remove_cv_ref_test_40();
|
||||
remove_cv_ref_test_41();
|
||||
remove_cv_ref_test_42();
|
||||
remove_cv_ref_test_43();
|
||||
remove_cv_ref_test_44();
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
remove_cv_ref_test_45();
|
||||
remove_cv_ref_test_46();
|
||||
remove_cv_ref_test_47();
|
||||
remove_cv_ref_test_48();
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
@ -8,6 +8,7 @@
|
||||
#define TT_TEST_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if defined(_WIN32_WCE) && defined(BOOST_MSVC)
|
||||
#pragma warning(disable:4201)
|
||||
@ -96,8 +97,34 @@ int error_count = 0;
|
||||
int main(){
|
||||
#define TT_TEST_END return error_count; }
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !BOOST_WORKAROUND(BOOST_GCC, < 40704)
|
||||
|
||||
#define TRANSFORM_CHECK_ALIASES(name, from_suffix, to_suffix)\
|
||||
BOOST_CHECK_TYPE(bool to_suffix, name##_t<bool from_suffix>);\
|
||||
BOOST_CHECK_TYPE(char to_suffix, name##_t<char from_suffix>);\
|
||||
BOOST_CHECK_TYPE(wchar_t to_suffix, name##_t<wchar_t from_suffix>);\
|
||||
BOOST_CHECK_TYPE(signed char to_suffix, name##_t<signed char from_suffix>);\
|
||||
BOOST_CHECK_TYPE(unsigned char to_suffix, name##_t<unsigned char from_suffix>);\
|
||||
BOOST_CHECK_TYPE(short to_suffix, name##_t<short from_suffix>);\
|
||||
BOOST_CHECK_TYPE(unsigned short to_suffix, name##_t<unsigned short from_suffix>);\
|
||||
BOOST_CHECK_TYPE(int to_suffix, name##_t<int from_suffix>);\
|
||||
BOOST_CHECK_TYPE(unsigned int to_suffix, name##_t<unsigned int from_suffix>);\
|
||||
BOOST_CHECK_TYPE(long to_suffix, name##_t<long from_suffix>);\
|
||||
BOOST_CHECK_TYPE(unsigned long to_suffix, name##_t<unsigned long from_suffix>);\
|
||||
BOOST_CHECK_TYPE(float to_suffix, name##_t<float from_suffix>);\
|
||||
BOOST_CHECK_TYPE(long double to_suffix, name##_t<long double from_suffix>);\
|
||||
BOOST_CHECK_TYPE(double to_suffix, name##_t<double from_suffix>);\
|
||||
BOOST_CHECK_TYPE(UDT to_suffix, name##_t<UDT from_suffix>);\
|
||||
BOOST_CHECK_TYPE(enum1 to_suffix, name##_t<enum1 from_suffix>);
|
||||
|
||||
#else
|
||||
|
||||
#define TRANSFORM_CHECK_ALIASES(name, from_suffix, to_suffix) /**/
|
||||
|
||||
#endif
|
||||
|
||||
#define TRANSFORM_CHECK(name, from_suffix, to_suffix)\
|
||||
TRANSFORM_CHECK_ALIASES(name, from_suffix, to_suffix)\
|
||||
BOOST_CHECK_TYPE(bool to_suffix, name<bool from_suffix>::type);\
|
||||
BOOST_CHECK_TYPE(char to_suffix, name<char from_suffix>::type);\
|
||||
BOOST_CHECK_TYPE(wchar_t to_suffix, name<wchar_t from_suffix>::type);\
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "test.hpp"
|
||||
#include "check_integral_constant.hpp"
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#ifdef TEST_STD
|
||||
# include <type_traits>
|
||||
#else
|
||||
@ -18,6 +19,8 @@
|
||||
|
||||
TT_TEST_BEGIN(rvalue_reference_test)
|
||||
|
||||
#if !(defined(CI_SUPPRESS_KNOWN_ISSUES) && BOOST_WORKAROUND(BOOST_MSVC, <= 1700))
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<int (&&)(int)>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference<int (&)(int)>::value, false);
|
||||
@ -26,6 +29,8 @@ BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int&&, int&>::value), false)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(), int(&&)()>::value), true);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user