diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0041d35 --- /dev/null +++ b/.travis.yml @@ -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 : -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 diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..61426ca --- /dev/null +++ b/appveyor.yml @@ -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 diff --git a/doc/add_const.qbk b/doc/add_const.qbk index c90cb9d..8f81025 100644 --- a/doc/add_const.qbk +++ b/doc/add_const.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using add_const_t = typename add_const::type; // C++11 and above + __type The same type as `T const` for all `T`. __std_ref 3.9.3. diff --git a/doc/add_cv.qbk b/doc/add_cv.qbk index f1cf590..3c6622a 100644 --- a/doc/add_cv.qbk +++ b/doc/add_cv.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using add_cv_t = typename add_cv::type; // C++11 and above + __type The same type as `T const volatile` for all `T`. __std_ref 3.9.3. diff --git a/doc/add_lvalue_reference.qbk b/doc/add_lvalue_reference.qbk index dc8de51..b3be371 100644 --- a/doc/add_lvalue_reference.qbk +++ b/doc/add_lvalue_reference.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using add_lvalue_reference_t = typename add_lvalue_reference::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`. diff --git a/doc/add_pointer.qbk b/doc/add_pointer.qbk index 9c8dc77..72b9c2b 100644 --- a/doc/add_pointer.qbk +++ b/doc/add_pointer.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using add_pointer_t = typename add_pointer::type; // C++11 and above + __type The same type as `remove_reference::type*`. The rationale for this template diff --git a/doc/add_reference.qbk b/doc/add_reference.qbk index 279d986..9d8bb4c 100644 --- a/doc/add_reference.qbk +++ b/doc/add_reference.qbk @@ -18,6 +18,8 @@ for backwards compatibility only. { typedef __below type; }; + + template using add_reference_t = typename add_reference::type; // C++11 and above __type If `T` is not a reference type then `T&`, otherwise `T`. diff --git a/doc/add_rvalue_reference.qbk b/doc/add_rvalue_reference.qbk index 24d460f..c490615 100644 --- a/doc/add_rvalue_reference.qbk +++ b/doc/add_rvalue_reference.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using add_rvalue_reference_t = typename add_rvalue_reference::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 diff --git a/doc/add_volatile.qbk b/doc/add_volatile.qbk index 206d7b5..9a30696 100644 --- a/doc/add_volatile.qbk +++ b/doc/add_volatile.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using add_volatile_t = typename add_volatile::type; // C++11 and above + __type The same type as `T volatile` for all `T`. __std_ref 3.9.3. diff --git a/doc/common_type.qbk b/doc/common_type.qbk index 801033f..3bf6058 100644 --- a/doc/common_type.qbk +++ b/doc/common_type.qbk @@ -15,6 +15,7 @@ __header ` #include ` or ` #include struct common_type; + template using common_type_t = typename common_type::type; // C++11 and above } diff --git a/doc/conditional.qbk b/doc/conditional.qbk index ae6e80f..b0aea68 100644 --- a/doc/conditional.qbk +++ b/doc/conditional.qbk @@ -14,6 +14,7 @@ __header ` #include ` or ` #include struct __conditional; + template using conditional_t = typename conditional::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. diff --git a/doc/copy_cv.qbk b/doc/copy_cv.qbk index 9f733a0..26a6e21 100644 --- a/doc/copy_cv.qbk +++ b/doc/copy_cv.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using copy_cv_t = typename copy_cv::type; // C++11 and above + __type [^T /cv/], where /cv/ are the cv-qualifiers of `U`. __header ` #include ` or ` #include ` diff --git a/doc/decay.qbk b/doc/decay.qbk index aa30a0a..cfa00cb 100644 --- a/doc/decay.qbk +++ b/doc/decay.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using decay_t = typename decay::type; // C++11 and above + __type Let `U` be the result of `remove_reference::type`, then if `U` is an array type, the result is `remove_extent::type*`, otherwise if `U` is a function type then the result is `U*`, otherwise the result is `U`. diff --git a/doc/floating_point_promotion.qbk b/doc/floating_point_promotion.qbk index ab3858c..2769586 100644 --- a/doc/floating_point_promotion.qbk +++ b/doc/floating_point_promotion.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using floating_point_promotion_t = typename floating_point_promotion::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. diff --git a/doc/html/boost_typetraits/reference/add_const.html b/doc/html/boost_typetraits/reference/add_const.html index 9f84ce4..b5d46b6 100644 --- a/doc/html/boost_typetraits/reference/add_const.html +++ b/doc/html/boost_typetraits/reference/add_const.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using add_const_t = typename add_const<T>::type; // C++11 and above

type: The same type as T diff --git a/doc/html/boost_typetraits/reference/add_cv.html b/doc/html/boost_typetraits/reference/add_cv.html index 2c6ef38..86b06e3 100644 --- a/doc/html/boost_typetraits/reference/add_cv.html +++ b/doc/html/boost_typetraits/reference/add_cv.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using add_cv_t = typename add_cv<T>::type; // C++11 and above

type: The same type as T diff --git a/doc/html/boost_typetraits/reference/add_lvalue_reference.html b/doc/html/boost_typetraits/reference/add_lvalue_reference.html index 0665fdc..7cd49aa 100644 --- a/doc/html/boost_typetraits/reference/add_lvalue_reference.html +++ b/doc/html/boost_typetraits/reference/add_lvalue_reference.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using add_lvalue_reference_t = typename add_lvalue_reference<T>::type; // C++11 and above

type: If T diff --git a/doc/html/boost_typetraits/reference/add_pointer.html b/doc/html/boost_typetraits/reference/add_pointer.html index a775a5e..e7cc376 100644 --- a/doc/html/boost_typetraits/reference/add_pointer.html +++ b/doc/html/boost_typetraits/reference/add_pointer.html @@ -31,6 +31,8 @@ { typedef see-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*. diff --git a/doc/html/boost_typetraits/reference/add_reference.html b/doc/html/boost_typetraits/reference/add_reference.html index 7023d53..4eae06f 100644 --- a/doc/html/boost_typetraits/reference/add_reference.html +++ b/doc/html/boost_typetraits/reference/add_reference.html @@ -43,6 +43,8 @@ { typedef see-below type; }; + +template <class T> using add_reference_t = typename add_reference<T>::type; // C++11 and above

type: If T diff --git a/doc/html/boost_typetraits/reference/add_rvalue_reference.html b/doc/html/boost_typetraits/reference/add_rvalue_reference.html index 2f148a9..7dbcd7d 100644 --- a/doc/html/boost_typetraits/reference/add_rvalue_reference.html +++ b/doc/html/boost_typetraits/reference/add_rvalue_reference.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; // C++11 and above

type: If T diff --git a/doc/html/boost_typetraits/reference/add_volatile.html b/doc/html/boost_typetraits/reference/add_volatile.html index d935768..7cbd22d 100644 --- a/doc/html/boost_typetraits/reference/add_volatile.html +++ b/doc/html/boost_typetraits/reference/add_volatile.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using add_volatile_t = typename add_volatile<T>::type; // C++11 and above

type: The same type as T diff --git a/doc/html/boost_typetraits/reference/common_type.html b/doc/html/boost_typetraits/reference/common_type.html index 6c78990..ae752ae 100644 --- a/doc/html/boost_typetraits/reference/common_type.html +++ b/doc/html/boost_typetraits/reference/common_type.html @@ -33,6 +33,7 @@

namespace boost {
   template <class... T> struct common_type;
+  template<class... T> using common_type_t = typename common_type<T...>::type; // C++11 and above
 }
 

diff --git a/doc/html/boost_typetraits/reference/conditional.html b/doc/html/boost_typetraits/reference/conditional.html index 7c7577c..53efe54 100644 --- a/doc/html/boost_typetraits/reference/conditional.html +++ b/doc/html/boost_typetraits/reference/conditional.html @@ -33,6 +33,7 @@

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
 }
 

diff --git a/doc/html/boost_typetraits/reference/copy_cv.html b/doc/html/boost_typetraits/reference/copy_cv.html index de91732..b2d88b2 100644 --- a/doc/html/boost_typetraits/reference/copy_cv.html +++ b/doc/html/boost_typetraits/reference/copy_cv.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T, class U> using copy_cv_t = typename copy_cv<T, U>::type; // C++11 and above

type: T cv, diff --git a/doc/html/boost_typetraits/reference/decay.html b/doc/html/boost_typetraits/reference/decay.html index fbbe632..def5120 100644 --- a/doc/html/boost_typetraits/reference/decay.html +++ b/doc/html/boost_typetraits/reference/decay.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using decay_t = typename decay<T>::type; // C++11 and above

type: Let U diff --git a/doc/html/boost_typetraits/reference/floating_point_promotion.html b/doc/html/boost_typetraits/reference/floating_point_promotion.html index afab9d8..14f98f2 100644 --- a/doc/html/boost_typetraits/reference/floating_point_promotion.html +++ b/doc/html/boost_typetraits/reference/floating_point_promotion.html @@ -31,6 +31,8 @@ { typedef see-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 diff --git a/doc/html/boost_typetraits/reference/integral_promotion.html b/doc/html/boost_typetraits/reference/integral_promotion.html index ca664ba..2f430a6 100644 --- a/doc/html/boost_typetraits/reference/integral_promotion.html +++ b/doc/html/boost_typetraits/reference/integral_promotion.html @@ -31,6 +31,8 @@ { typedef see-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 diff --git a/doc/html/boost_typetraits/reference/make_signed.html b/doc/html/boost_typetraits/reference/make_signed.html index 2baa3af..3651b22 100644 --- a/doc/html/boost_typetraits/reference/make_signed.html +++ b/doc/html/boost_typetraits/reference/make_signed.html @@ -31,6 +31,8 @@ { typedef see-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 diff --git a/doc/html/boost_typetraits/reference/make_unsigned.html b/doc/html/boost_typetraits/reference/make_unsigned.html index 740206e..bb9bb38 100644 --- a/doc/html/boost_typetraits/reference/make_unsigned.html +++ b/doc/html/boost_typetraits/reference/make_unsigned.html @@ -31,6 +31,8 @@ { typedef see-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 diff --git a/doc/html/boost_typetraits/reference/make_void.html b/doc/html/boost_typetraits/reference/make_void.html new file mode 100644 index 0000000..13c1369 --- /dev/null +++ b/doc/html/boost_typetraits/reference/make_void.html @@ -0,0 +1,179 @@ + + + +make_void + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+


+
+PrevUpHomeNext +
+
+ +
template<class...>
+struct make_void
+{
+    typedef void type;
+};
+
+template<class... Ts>
+using void_t = typename make_void<Ts...>::type;
+
+

+ type: The type void + for all T. +

+

+ Header: #include + <boost/type_traits/make_void.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.25. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ make_void<int>::type +

+
+

+ void +

+
+

+ make_void<int&>::type +

+
+

+ void +

+
+

+ make_void<int(*)(int)>::type +

+
+

+ void +

+
+

+ make_void<int[]>::type +

+
+

+ void +

+
+

+ make_void<int[1]>::type +

+
+

+ void +

+
+

+ make_void<>::type +

+
+

+ void +

+
+

+ make_void<int, int>::type +

+
+

+ void +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. However, the type alias void_t + is only available if the compiler supports template aliases. Further, in + the absence of variadic-template support, make_void + only supports up to 5 parameters. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/promote.html b/doc/html/boost_typetraits/reference/promote.html index c1bd9df..585feff 100644 --- a/doc/html/boost_typetraits/reference/promote.html +++ b/doc/html/boost_typetraits/reference/promote.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using promote_t = typename promote<T>::type; // C++11 and above

type: If integral or floating point promotion diff --git a/doc/html/boost_typetraits/reference/remove_all_extents.html b/doc/html/boost_typetraits/reference/remove_all_extents.html index a1e4beb..ac3fa74 100644 --- a/doc/html/boost_typetraits/reference/remove_all_extents.html +++ b/doc/html/boost_typetraits/reference/remove_all_extents.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using remove_all_extents_t = typename remove_all_extents<T>::type; // C++11 and above

type: If T diff --git a/doc/html/boost_typetraits/reference/remove_const.html b/doc/html/boost_typetraits/reference/remove_const.html index ed4e887..2d54789 100644 --- a/doc/html/boost_typetraits/reference/remove_const.html +++ b/doc/html/boost_typetraits/reference/remove_const.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using remove_const_t = typename remove_const<T>::type; // C++11 and above

type: The same type as T, diff --git a/doc/html/boost_typetraits/reference/remove_cv.html b/doc/html/boost_typetraits/reference/remove_cv.html index bbb0956..c35fe98 100644 --- a/doc/html/boost_typetraits/reference/remove_cv.html +++ b/doc/html/boost_typetraits/reference/remove_cv.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using remove_cv_t = typename remove_cv<T>::type; // C++11 and above

type: The same type as T, diff --git a/doc/html/boost_typetraits/reference/remove_extent.html b/doc/html/boost_typetraits/reference/remove_extent.html index 9a570c4..4ccdd0b 100644 --- a/doc/html/boost_typetraits/reference/remove_extent.html +++ b/doc/html/boost_typetraits/reference/remove_extent.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using remove_extent_t = typename remove_extent<T>::type; // C++11 and above

type: If T diff --git a/doc/html/boost_typetraits/reference/remove_pointer.html b/doc/html/boost_typetraits/reference/remove_pointer.html index d94817f..9346b3b 100644 --- a/doc/html/boost_typetraits/reference/remove_pointer.html +++ b/doc/html/boost_typetraits/reference/remove_pointer.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using remove_pointer_t = typename remove_pointer<T>::type; // C++11 and above

type: The same type as T, diff --git a/doc/html/boost_typetraits/reference/remove_reference.html b/doc/html/boost_typetraits/reference/remove_reference.html index 439559b..689505a 100644 --- a/doc/html/boost_typetraits/reference/remove_reference.html +++ b/doc/html/boost_typetraits/reference/remove_reference.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using remove_reference_t = typename remove_reference<T>::type; // C++11 and above

type: The same type as T, diff --git a/doc/html/boost_typetraits/reference/remove_volatile.html b/doc/html/boost_typetraits/reference/remove_volatile.html index f9eeba6..763e553 100644 --- a/doc/html/boost_typetraits/reference/remove_volatile.html +++ b/doc/html/boost_typetraits/reference/remove_volatile.html @@ -31,6 +31,8 @@ { typedef see-below type; }; + +template <class T> using remove_volatile_t = typename remove_volatile<T>::type; // C++11 and above

type: The same type as T, diff --git a/doc/html/boost_typetraits/reference/type_identity.html b/doc/html/boost_typetraits/reference/type_identity.html index f8de9b0..2d45c81 100644 --- a/doc/html/boost_typetraits/reference/type_identity.html +++ b/doc/html/boost_typetraits/reference/type_identity.html @@ -31,6 +31,8 @@ { typedef T type; }; + +template <class T> using type_identity_t = typename type_identity<T>::type; // C++11 and above

Header: #include diff --git a/doc/html/index/s11.html b/doc/html/index/s11.html index bcebfb1..cd2feda 100644 --- a/doc/html/index/s11.html +++ b/doc/html/index/s11.html @@ -24,7 +24,7 @@

-Class Index

+Class Index

A C D E F H I M N O P R T

diff --git a/doc/html/index/s12.html b/doc/html/index/s12.html index 5371cf1..0f4c434 100644 --- a/doc/html/index/s12.html +++ b/doc/html/index/s12.html @@ -24,7 +24,7 @@

-Typedef Index

+Typedef Index

F R T V

diff --git a/doc/html/index/s13.html b/doc/html/index/s13.html index d7dd9da..f96b664 100644 --- a/doc/html/index/s13.html +++ b/doc/html/index/s13.html @@ -24,7 +24,7 @@

-Macro Index

+Macro Index

B

diff --git a/doc/html/index/s14.html b/doc/html/index/s14.html index c7240b5..e4bf2a8 100644 --- a/doc/html/index/s14.html +++ b/doc/html/index/s14.html @@ -23,7 +23,7 @@

-Index

+Index

A B C D E F H I M N O P R T U V

diff --git a/doc/integral_promotion.qbk b/doc/integral_promotion.qbk index a83d49b..1b69792 100644 --- a/doc/integral_promotion.qbk +++ b/doc/integral_promotion.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using integral_promotion_t = typename integral_promotion::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. diff --git a/doc/make_signed.qbk b/doc/make_signed.qbk index cba7b19..fcc1774 100644 --- a/doc/make_signed.qbk +++ b/doc/make_signed.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using make_signed_t = typename make_signed::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 diff --git a/doc/make_unsigned.qbk b/doc/make_unsigned.qbk index 2e6cb41..a4d7774 100644 --- a/doc/make_unsigned.qbk +++ b/doc/make_unsigned.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using make_unsigned_t = typename make_unsigned::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 diff --git a/doc/promote.qbk b/doc/promote.qbk index 0ce8370..4e4029c 100644 --- a/doc/promote.qbk +++ b/doc/promote.qbk @@ -13,6 +13,8 @@ typedef __below type; }; + template using promote_t = typename promote::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 diff --git a/doc/remove_all_extents.qbk b/doc/remove_all_extents.qbk index be9d309..0b72a09 100644 --- a/doc/remove_all_extents.qbk +++ b/doc/remove_all_extents.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using remove_all_extents_t = typename remove_all_extents::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. diff --git a/doc/remove_const.qbk b/doc/remove_const.qbk index ea3b7e1..356af79 100644 --- a/doc/remove_const.qbk +++ b/doc/remove_const.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using remove_const_t = typename remove_const::type; // C++11 and above + __type The same type as `T`, but with any /top level/ const-qualifier removed. __std_ref 3.9.3. diff --git a/doc/remove_cv.qbk b/doc/remove_cv.qbk index c7a296b..d0dd334 100644 --- a/doc/remove_cv.qbk +++ b/doc/remove_cv.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using remove_cv_t = typename remove_cv::type; // C++11 and above + __type The same type as `T`, but with any /top level/ cv-qualifiers removed. __std_ref 3.9.3. diff --git a/doc/remove_cv_ref.qbk b/doc/remove_cv_ref.qbk new file mode 100644 index 0000000..6eea8f1 --- /dev/null +++ b/doc/remove_cv_ref.qbk @@ -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 + struct remove_cv_ref + { + typedef __below type; + }; + + template using remove_cv_ref_t = typename remove_cv_ref::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 ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`remove_cv_ref::type`][`int`]] + +[[`remove_cv_ref::type`] [`int`]] + +[[`remove_cv_ref::type`] [`int`]] + +[[`remove_cv_ref::type`] [`int`]] + +[[`remove_cv_ref::type`] [`int const*`]] + +] + +[endsect] + diff --git a/doc/remove_extent.qbk b/doc/remove_extent.qbk index fe5f3f1..dbcfee9 100644 --- a/doc/remove_extent.qbk +++ b/doc/remove_extent.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using remove_extent_t = typename remove_extent::type; // C++11 and above + __type If `T` is an array type, then removes the topmost array bound, otherwise leaves `T` unchanged. diff --git a/doc/remove_pointer.qbk b/doc/remove_pointer.qbk index 7f0af89..cbc3fa3 100644 --- a/doc/remove_pointer.qbk +++ b/doc/remove_pointer.qbk @@ -13,6 +13,8 @@ typedef __below type; }; + template using remove_pointer_t = typename remove_pointer::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. diff --git a/doc/remove_reference.qbk b/doc/remove_reference.qbk index a8af148..308b520 100644 --- a/doc/remove_reference.qbk +++ b/doc/remove_reference.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using remove_reference_t = typename remove_reference::type; // C++11 and above + __type The same type as `T`, but with any reference modifier removed. __std_ref 8.3.2. diff --git a/doc/remove_volatile.qbk b/doc/remove_volatile.qbk index 822661e..8bb8350 100644 --- a/doc/remove_volatile.qbk +++ b/doc/remove_volatile.qbk @@ -12,7 +12,9 @@ { typedef __below type; }; - + + template using remove_volatile_t = typename remove_volatile::type; // C++11 and above + __type The same type as `T`, but with any /top level/ volatile-qualifier removed. __std_ref 3.9.3. diff --git a/doc/type_identity.qbk b/doc/type_identity.qbk index 975653d..5fe7e92 100644 --- a/doc/type_identity.qbk +++ b/doc/type_identity.qbk @@ -12,6 +12,8 @@ { typedef T type; }; + + template using type_identity_t = typename type_identity::type; // C++11 and above __header ` #include ` or ` #include ` diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index dd9bfc6..1a1fa5b 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -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] diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index 93a992d..dbc8c95 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -136,6 +136,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/type_traits/add_const.hpp b/include/boost/type_traits/add_const.hpp index a9fb781..2d60118 100644 --- a/include/boost/type_traits/add_const.hpp +++ b/include/boost/type_traits/add_const.hpp @@ -41,6 +41,12 @@ namespace boost { typedef T& type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using add_const_t = typename add_const::type; + +#endif + } // namespace boost #endif // BOOST_TT_ADD_CONST_HPP_INCLUDED diff --git a/include/boost/type_traits/add_cv.hpp b/include/boost/type_traits/add_cv.hpp index e62ddee..425d019 100644 --- a/include/boost/type_traits/add_cv.hpp +++ b/include/boost/type_traits/add_cv.hpp @@ -36,6 +36,12 @@ template struct add_cv{ typedef T const volatile type; }; template struct add_cv{ typedef T& type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using add_cv_t = typename add_cv::type; + +#endif + } // namespace boost #endif // BOOST_TT_ADD_CV_HPP_INCLUDED diff --git a/include/boost/type_traits/add_lvalue_reference.hpp b/include/boost/type_traits/add_lvalue_reference.hpp index 41851a1..26b74e6 100644 --- a/include/boost/type_traits/add_lvalue_reference.hpp +++ b/include/boost/type_traits/add_lvalue_reference.hpp @@ -22,6 +22,12 @@ template struct add_lvalue_reference }; #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using add_lvalue_reference_t = typename add_lvalue_reference::type; + +#endif + } #endif // BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP diff --git a/include/boost/type_traits/add_pointer.hpp b/include/boost/type_traits/add_pointer.hpp index 745f63a..85ad33a 100644 --- a/include/boost/type_traits/add_pointer.hpp +++ b/include/boost/type_traits/add_pointer.hpp @@ -56,6 +56,12 @@ struct add_pointer #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using add_pointer_t = typename add_pointer::type; + +#endif + } // namespace boost #endif // BOOST_TT_ADD_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/add_reference.hpp b/include/boost/type_traits/add_reference.hpp index 3c91415..33e9bc7 100644 --- a/include/boost/type_traits/add_reference.hpp +++ b/include/boost/type_traits/add_reference.hpp @@ -54,6 +54,13 @@ template <> struct add_reference { typedef const volatile v template <> struct add_reference { typedef volatile void type; }; #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + +template using add_reference_t = typename add_reference::type; + +#endif + + } // namespace boost #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/add_rvalue_reference.hpp b/include/boost/type_traits/add_rvalue_reference.hpp index 44ead34..ad64894 100644 --- a/include/boost/type_traits/add_rvalue_reference.hpp +++ b/include/boost/type_traits/add_rvalue_reference.hpp @@ -58,6 +58,12 @@ template struct add_rvalue_reference typedef typename boost::type_traits_detail::add_rvalue_reference_imp::type type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using add_rvalue_reference_t = typename add_rvalue_reference::type; + +#endif + } // namespace boost #endif // BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP diff --git a/include/boost/type_traits/add_volatile.hpp b/include/boost/type_traits/add_volatile.hpp index 24f515c..253751a 100644 --- a/include/boost/type_traits/add_volatile.hpp +++ b/include/boost/type_traits/add_volatile.hpp @@ -35,6 +35,12 @@ template struct add_volatile{ typedef T volatile type; }; template struct add_volatile{ typedef T& type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using add_volatile_t = typename add_volatile::type; + +#endif + } // namespace boost #endif // BOOST_TT_ADD_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/conditional.hpp b/include/boost/type_traits/conditional.hpp index b7e82db..5890198 100644 --- a/include/boost/type_traits/conditional.hpp +++ b/include/boost/type_traits/conditional.hpp @@ -14,6 +14,12 @@ namespace boost { template struct conditional { typedef T type; }; template struct conditional { typedef U type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using conditional_t = typename conditional::type; + +#endif + } // namespace boost diff --git a/include/boost/type_traits/copy_cv.hpp b/include/boost/type_traits/copy_cv.hpp index 1605ca3..2f3dc37 100644 --- a/include/boost/type_traits/copy_cv.hpp +++ b/include/boost/type_traits/copy_cv.hpp @@ -29,6 +29,12 @@ public: typedef typename boost::conditional::value, typename boost::add_volatile::type, CT>::type type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using copy_cv_t = typename copy_cv::type; + +#endif + } // namespace boost #endif // #ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED diff --git a/include/boost/type_traits/decay.hpp b/include/boost/type_traits/decay.hpp index 4e81184..5b28d05 100644 --- a/include/boost/type_traits/decay.hpp +++ b/include/boost/type_traits/decay.hpp @@ -37,6 +37,12 @@ namespace boost typedef typename boost::detail::decay_imp::value, boost::is_function::value>::type type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using decay_t = typename decay::type; + +#endif + } // namespace boost diff --git a/include/boost/type_traits/floating_point_promotion.hpp b/include/boost/type_traits/floating_point_promotion.hpp index 993e14e..0e709b7 100644 --- a/include/boost/type_traits/floating_point_promotion.hpp +++ b/include/boost/type_traits/floating_point_promotion.hpp @@ -14,6 +14,12 @@ namespace boost { template<> struct floating_point_promotion{ typedef double volatile type; }; template<> struct floating_point_promotion { typedef double const volatile type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using floating_point_promotion_t = typename floating_point_promotion::type; + +#endif + } #endif // #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED diff --git a/include/boost/type_traits/integral_promotion.hpp b/include/boost/type_traits/integral_promotion.hpp index 0478f56..526f90c 100644 --- a/include/boost/type_traits/integral_promotion.hpp +++ b/include/boost/type_traits/integral_promotion.hpp @@ -175,6 +175,12 @@ public: typedef typename boost::type_traits::detail::integral_promotion::type type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using integral_promotion_t = typename integral_promotion::type; + +#endif + } #endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED diff --git a/include/boost/type_traits/make_signed.hpp b/include/boost/type_traits/make_signed.hpp index 0d2d5df..6d8b1fb 100644 --- a/include/boost/type_traits/make_signed.hpp +++ b/include/boost/type_traits/make_signed.hpp @@ -125,6 +125,12 @@ public: >::type type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using make_signed_t = typename make_signed::type; + +#endif + } // namespace boost #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/make_unsigned.hpp b/include/boost/type_traits/make_unsigned.hpp index 4b21eba..17a8a5b 100644 --- a/include/boost/type_traits/make_unsigned.hpp +++ b/include/boost/type_traits/make_unsigned.hpp @@ -124,6 +124,12 @@ public: >::type type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using make_unsigned_t = typename make_unsigned::type; + +#endif + } // namespace boost #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/promote.hpp b/include/boost/type_traits/promote.hpp index 587617a..1678e1c 100644 --- a/include/boost/type_traits/promote.hpp +++ b/include/boost/type_traits/promote.hpp @@ -14,6 +14,12 @@ namespace boost { template struct promote : public integral_promotion::type>{}; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using promote_t = typename promote::type; + +#endif + } #endif // #ifndef FILE_boost_type_traits_promote_hpp_INCLUDED diff --git a/include/boost/type_traits/remove_all_extents.hpp b/include/boost/type_traits/remove_all_extents.hpp index 90c90d3..b9736db 100644 --- a/include/boost/type_traits/remove_all_extents.hpp +++ b/include/boost/type_traits/remove_all_extents.hpp @@ -30,6 +30,12 @@ template struct remove_all_extents : public remove #endif #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using remove_all_extents_t = typename remove_all_extents::type; + +#endif + } // namespace boost #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_bounds.hpp b/include/boost/type_traits/remove_bounds.hpp index 56988d2..cd0565d 100644 --- a/include/boost/type_traits/remove_bounds.hpp +++ b/include/boost/type_traits/remove_bounds.hpp @@ -16,6 +16,13 @@ namespace boost template struct remove_bounds : public remove_extent {}; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + +template using remove_bounds_t = typename remove_bounds::type; + +#endif + + } // namespace boost #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_const.hpp b/include/boost/type_traits/remove_const.hpp index e238962..6f1a193 100644 --- a/include/boost/type_traits/remove_const.hpp +++ b/include/boost/type_traits/remove_const.hpp @@ -28,6 +28,12 @@ namespace boost { #endif #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using remove_const_t = typename remove_const::type; + +#endif + } // namespace boost #endif // BOOST_TT_REMOVE_CONST_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_cv.hpp b/include/boost/type_traits/remove_cv.hpp index 08393cf..57a96f2 100644 --- a/include/boost/type_traits/remove_cv.hpp +++ b/include/boost/type_traits/remove_cv.hpp @@ -34,6 +34,11 @@ template struct remove_cv{ typedef T type[]; }; #endif #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using remove_cv_t = typename remove_cv::type; + +#endif } // namespace boost diff --git a/include/boost/type_traits/remove_cv_ref.hpp b/include/boost/type_traits/remove_cv_ref.hpp new file mode 100644 index 0000000..118945a --- /dev/null +++ b/include/boost/type_traits/remove_cv_ref.hpp @@ -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 +#include +#include + +namespace boost { + + template struct remove_cv_ref: remove_cv::type> {}; + + +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using remove_cv_ref_t = typename remove_cv_ref::type; + +#endif + +} // namespace boost + +#endif // BOOST_TT_REMOVE_CV_REF_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_extent.hpp b/include/boost/type_traits/remove_extent.hpp index b6528e5..55d5730 100644 --- a/include/boost/type_traits/remove_extent.hpp +++ b/include/boost/type_traits/remove_extent.hpp @@ -30,6 +30,12 @@ template struct remove_extent { typedef T const #endif #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using remove_extent_t = typename remove_extent::type; + +#endif + } // namespace boost #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_pointer.hpp b/include/boost/type_traits/remove_pointer.hpp index 9216652..a7baa76 100644 --- a/include/boost/type_traits/remove_pointer.hpp +++ b/include/boost/type_traits/remove_pointer.hpp @@ -72,6 +72,12 @@ template struct remove_pointer{ typedef T type; }; #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using remove_pointer_t = typename remove_pointer::type; + +#endif + } // namespace boost #endif // BOOST_TT_REMOVE_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_reference.hpp b/include/boost/type_traits/remove_reference.hpp index f75e677..70949fb 100644 --- a/include/boost/type_traits/remove_reference.hpp +++ b/include/boost/type_traits/remove_reference.hpp @@ -48,6 +48,11 @@ template struct remove_reference{ typedef T type; }; template struct remove_reference{ typedef T type; }; #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using remove_reference_t = typename remove_reference::type; + +#endif } // namespace boost diff --git a/include/boost/type_traits/remove_volatile.hpp b/include/boost/type_traits/remove_volatile.hpp index f5870f3..bf2c557 100644 --- a/include/boost/type_traits/remove_volatile.hpp +++ b/include/boost/type_traits/remove_volatile.hpp @@ -28,6 +28,11 @@ namespace boost { #endif #endif +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + template using remove_volatile_t = typename remove_volatile::type; + +#endif } // namespace boost diff --git a/include/boost/type_traits/type_identity.hpp b/include/boost/type_traits/type_identity.hpp index 6d2dd5b..73cb3f3 100644 --- a/include/boost/type_traits/type_identity.hpp +++ b/include/boost/type_traits/type_identity.hpp @@ -17,6 +17,13 @@ template struct type_identity typedef T type; }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + +template using type_identity_t = typename type_identity::type; + +#endif + + } // namespace boost #endif // #ifndef BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED diff --git a/test/aligned_storage_a2_test.cpp b/test/aligned_storage_a2_test.cpp index f339359..229f402 100644 --- a/test/aligned_storage_a2_test.cpp +++ b/test/aligned_storage_a2_test.cpp @@ -35,7 +35,14 @@ template void do_check(const T&) { typedef typename tt::aligned_storage::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 pod1; no_unused_warning(as1); no_unused_warning(pod1); @@ -46,7 +53,11 @@ void do_check(const T&) BOOST_CHECK(::tt::is_pod::value == true); #endif typedef typename tt::aligned_storage::type t2; +#if defined(BOOST_GCC) && (BOOST_GCC < 40800) + t2 as2 = {{{ 0, }}}; +#else t2 as2 = { 0, }; +#endif must_be_pod 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::type t3; +#if defined(BOOST_GCC) && (BOOST_GCC < 40800) + t3 as3 = {{{ 0, }}}; +#else t3 as3 = { 0, }; +#endif must_be_pod pod3; no_unused_warning(as3); no_unused_warning(pod3); diff --git a/test/cxx14_aliases_test.cpp b/test/cxx14_aliases_test.cpp new file mode 100644 index 0000000..3f7d6ab --- /dev/null +++ b/test/cxx14_aliases_test.cpp @@ -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 +#else +# include +#endif +#include + +TT_TEST_BEGIN(cxx14_aliases_test) +{ +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + BOOST_CHECK_TYPE(tt::add_const_t, int const); + BOOST_CHECK_TYPE(tt::add_cv_t, int const volatile); + BOOST_CHECK_TYPE(tt::add_lvalue_reference_t, int&); + BOOST_CHECK_TYPE(tt::add_pointer_t, int*); + BOOST_CHECK_TYPE(tt::add_rvalue_reference_t, int&&); + BOOST_CHECK_TYPE(tt::add_volatile_t, int volatile); + BOOST_CHECK_TYPE3(tt::common_type_t, int); + BOOST_CHECK_TYPE4(tt::conditional_t, char); + BOOST_CHECK_TYPE4(tt::conditional_t, short); + BOOST_CHECK_TYPE3(tt::copy_cv_t, char const volatile); + BOOST_CHECK_TYPE(tt::decay_t, char const*); + BOOST_CHECK_TYPE(tt::make_signed_t, signed char); + BOOST_CHECK_TYPE(tt::make_unsigned_t, unsigned char); + BOOST_CHECK_TYPE(tt::remove_all_extents_t, int); + BOOST_CHECK_TYPE(tt::remove_const_t, int); + BOOST_CHECK_TYPE(tt::remove_cv_t, int); + BOOST_CHECK_TYPE(tt::remove_extent_t, int); + BOOST_CHECK_TYPE(tt::remove_pointer_t, int); + BOOST_CHECK_TYPE(tt::remove_reference_t, int); + BOOST_CHECK_TYPE(tt::remove_volatile_t, int); + BOOST_CHECK_TYPE(tt::floating_point_promotion_t, double); + BOOST_CHECK_TYPE(tt::integral_promotion_t, int); + BOOST_CHECK_TYPE(tt::promote_t, int); + +#endif +} +TT_TEST_END diff --git a/test/has_nothrow_constr_test.cpp b/test/has_nothrow_constr_test.cpp index 0cc5cb7..0697276 100644 --- a/test/has_nothrow_constr_test.cpp +++ b/test/has_nothrow_constr_test.cpp @@ -210,7 +210,9 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::v #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); #endif +#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#endif #ifndef BOOST_NO_CXX11_NOEXCEPT BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); #endif diff --git a/test/has_nothrow_copy_test.cpp b/test/has_nothrow_copy_test.cpp index 034cb65..68680bc 100644 --- a/test/has_nothrow_copy_test.cpp +++ b/test/has_nothrow_copy_test.cpp @@ -238,8 +238,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_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::value, false); #endif +#endif TT_TEST_END diff --git a/test/is_default_constr_test.cpp b/test/is_default_constr_test.cpp index acc09ac..3780403 100644 --- a/test/is_default_constr_test.cpp +++ b/test/is_default_constr_test.cpp @@ -198,7 +198,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible:: #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::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::value, false); #endif diff --git a/test/is_destructible_test.cpp b/test/is_destructible_test.cpp index 872f21b..cdf81ef 100644 --- a/test/is_destructible_test.cpp +++ b/test/is_destructible_test.cpp @@ -180,9 +180,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::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::value, false); #endif +#endif TT_TEST_END diff --git a/test/is_nothrow_move_assignable_test.cpp b/test/is_nothrow_move_assignable_test.cpp index b16af9d..32f8a57 100644 --- a/test/is_nothrow_move_assignable_test.cpp +++ b/test/is_nothrow_move_assignable_test.cpp @@ -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 #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 #else @@ -216,9 +220,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, fal BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); +#if !(defined(BOOST_MSVC) && defined(CI_SUPPRESS_KNOWN_ISSUES) && (BOOST_MSVC < 1910)) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); +#endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); @@ -251,5 +257,9 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable + +#if !(defined(BOOST_MSVC) && defined(BOOST_TT_DISABLE_INTRINSICS) && defined(CI_SUPPRESS_KNOWN_ISSUES)) + #include "check_integral_constant.hpp" #ifdef TEST_STD # include @@ -231,8 +234,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); +#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::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::value, true, false); @@ -245,7 +250,9 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); +#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); +#endif #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); @@ -253,10 +260,17 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible:: #if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::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::value, true); #endif +#endif TT_TEST_END +#else +int main() { return 0; } + +#endif diff --git a/test/promote_enum_msvc_bug_test.cpp b/test/promote_enum_msvc_bug_test.cpp index 3c6c9a7..8893818 100644 --- a/test/promote_enum_msvc_bug_test.cpp +++ b/test/promote_enum_msvc_bug_test.cpp @@ -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; diff --git a/test/remove_cv_ref_test.cpp b/test/remove_cv_ref_test.cpp new file mode 100644 index 0000000..e825811 --- /dev/null +++ b/test/remove_cv_ref_test.cpp @@ -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 +#else +# include +#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 + diff --git a/test/test.hpp b/test/test.hpp index 6514dab..d272020 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -8,6 +8,7 @@ #define TT_TEST_HPP #include +#include #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);\ + BOOST_CHECK_TYPE(char to_suffix, name##_t);\ + BOOST_CHECK_TYPE(wchar_t to_suffix, name##_t);\ + BOOST_CHECK_TYPE(signed char to_suffix, name##_t);\ + BOOST_CHECK_TYPE(unsigned char to_suffix, name##_t);\ + BOOST_CHECK_TYPE(short to_suffix, name##_t);\ + BOOST_CHECK_TYPE(unsigned short to_suffix, name##_t);\ + BOOST_CHECK_TYPE(int to_suffix, name##_t);\ + BOOST_CHECK_TYPE(unsigned int to_suffix, name##_t);\ + BOOST_CHECK_TYPE(long to_suffix, name##_t);\ + BOOST_CHECK_TYPE(unsigned long to_suffix, name##_t);\ + BOOST_CHECK_TYPE(float to_suffix, name##_t);\ + BOOST_CHECK_TYPE(long double to_suffix, name##_t);\ + BOOST_CHECK_TYPE(double to_suffix, name##_t);\ + BOOST_CHECK_TYPE(UDT to_suffix, name##_t);\ + BOOST_CHECK_TYPE(enum1 to_suffix, name##_t); + +#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::type);\ BOOST_CHECK_TYPE(char to_suffix, name::type);\ BOOST_CHECK_TYPE(wchar_t to_suffix, name::type);\ diff --git a/test/tricky_rvalue_test.cpp b/test/tricky_rvalue_test.cpp index 85d4d9e..4edd44e 100644 --- a/test/tricky_rvalue_test.cpp +++ b/test/tricky_rvalue_test.cpp @@ -6,6 +6,7 @@ #include "test.hpp" #include "check_integral_constant.hpp" +#include #ifdef TEST_STD # include #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::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, false); @@ -26,6 +29,8 @@ BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false) BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); #endif +#endif + TT_TEST_END