brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · ef4d7db Raw
47 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// type_traits10 11// remove_cv12 13#include <type_traits>14 15#include "test_macros.h"16 17template <class T, class U>18void test_remove_cv_imp()19{20    ASSERT_SAME_TYPE(U, typename std::remove_cv<T>::type);21#if TEST_STD_VER > 1122    ASSERT_SAME_TYPE(U,        std::remove_cv_t<T>);23#endif24}25 26template <class T>27void test_remove_cv()28{29    test_remove_cv_imp<T, T>();30    test_remove_cv_imp<const T, T>();31    test_remove_cv_imp<volatile T, T>();32    test_remove_cv_imp<const volatile T, T>();33}34 35int main(int, char**)36{37    test_remove_cv<void>();38    test_remove_cv<int>();39    test_remove_cv<int[3]>();40    test_remove_cv<int&>();41    test_remove_cv<const int&>();42    test_remove_cv<int*>();43    test_remove_cv<const int*>();44 45  return 0;46}47