Polyfills: test remove_cv

This commit is contained in:
Benoit Blanchon
2024-11-25 11:26:40 +01:00
parent afc0a29c2c
commit 5f8e3c0f0f

View File

@ -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);