Kaynağa Gözat

Polyfills: test `remove_cv`

Benoit Blanchon 1 yıl önce
ebeveyn
işleme
5f8e3c0f0f
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. 8 0
      extras/tests/Misc/TypeTraits.cpp

+ 8 - 0
extras/tests/Misc/TypeTraits.cpp

@@ -212,6 +212,14 @@ TEST_CASE("Polyfills/type_traits") {
     CHECK(is_enum<double>::value == false);
   }
 
+  SECTION("remove_cv") {
+    CHECK(is_same<remove_cv_t<const int>, int>::value);
+    CHECK(is_same<remove_cv_t<volatile int>, int>::value);
+    CHECK(is_same<remove_cv_t<const volatile int>, int>::value);
+    CHECK(is_same<remove_cv_t<int>, int>::value);
+    CHECK(is_same<remove_cv_t<decltype("toto")>, decltype("toto")>::value);
+  }
+
   SECTION("decay") {
     CHECK(is_same<decay_t<int>, int>::value);
     CHECK(is_same<decay_t<int&>, int>::value);