Skip to content

Commit f317c4e

Browse files
authored
Merge pull request #406 from elbeno/remove-standard-stuff
🔥 Remove a couple of now-standard type traits
2 parents ab45f4f + 0b26d4e commit f317c4e

6 files changed

Lines changed: 1 addition & 52 deletions

File tree

docs/type_traits.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ contains a few things from the standard:
77
* https://en.cppreference.com/w/cpp/types/conditional[`conditional_t`]
88
(implemented with fewer template instantiations than a typical standard
99
implementation)
10-
* https://en.cppreference.com/w/cpp/types/is_constant_evaluated[`is_constant_evaluated`] (from C++20)
1110
* https://en.cppreference.com/w/cpp/types/is_function[`is_function_v`] (implemented with Walter Brown's method)
12-
* https://en.cppreference.com/w/cpp/types/is_scoped_enum[`is_scoped_enum_v`] (from C++23)
1311
* https://en.cppreference.com/w/cpp/utility/to_underlying[`to_underlying`] (from C++23)
1412
* https://en.cppreference.com/w/cpp/types/type_identity[`type_identity`] (from C++20)
1513

include/stdx/tuple.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <stdx/concepts.hpp>
4+
#include <stdx/ct_conversions.hpp>
45
#include <stdx/type_traits.hpp>
56
#include <stdx/udls.hpp>
67
#include <stdx/utility.hpp>
@@ -27,7 +28,6 @@ template <typename> struct tag_constant;
2728
template <typename T> constexpr static tag_constant<T> *tag{};
2829

2930
namespace error {
30-
template <typename...> constexpr auto always_false_v = false;
3131
template <typename T> struct type_from_tag_constant {
3232
using type = T;
3333
};

include/stdx/type_traits.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ constexpr bool is_function_object_v = detail::is_func_obj<T>;
6666
template <typename T>
6767
constexpr bool is_callable_v = is_function_v<T> or is_function_object_v<T>;
6868

69-
constexpr auto is_constant_evaluated() noexcept -> bool {
70-
return __builtin_is_constant_evaluated();
71-
}
72-
7369
template <typename T> struct type_identity {
7470
using type = T;
7571
};
@@ -115,12 +111,6 @@ constexpr auto is_specialization_of()
115111
return {};
116112
}
117113

118-
template <typename E>
119-
constexpr bool is_scoped_enum_v =
120-
std::is_enum_v<E> and not std::is_convertible_v<E, underlying_type_t<E>>;
121-
template <typename E>
122-
using is_scoped_enum = std::bool_constant<is_scoped_enum_v<E>>;
123-
124114
template <typename...> struct type_list {};
125115
template <auto...> struct value_list {};
126116

test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ add_tests(
5353
intrusive_forward_list
5454
intrusive_list
5555
intrusive_list_properties
56-
is_constant_evaluated
5756
iterator
5857
latched
5958
numeric

test/is_constant_evaluated.cpp

Lines changed: 0 additions & 23 deletions
This file was deleted.

test/type_traits.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,6 @@ TEST_CASE("derived types are not specializations (value templates)",
7171
not stdx::is_specialization_of<value_derived_t<0>, value_unary_t>());
7272
}
7373

74-
namespace {
75-
enum E1 {};
76-
enum struct E2 {};
77-
} // namespace
78-
79-
TEST_CASE("is_scoped_enum", "[type_traits]") {
80-
STATIC_REQUIRE(not stdx::is_scoped_enum_v<int>);
81-
STATIC_REQUIRE(not stdx::is_scoped_enum_v<E1>);
82-
STATIC_REQUIRE(stdx::is_scoped_enum_v<E2>);
83-
84-
STATIC_REQUIRE(not stdx::is_scoped_enum<int>::value);
85-
STATIC_REQUIRE(not stdx::is_scoped_enum<E1>::value);
86-
STATIC_REQUIRE(stdx::is_scoped_enum<E2>::value);
87-
}
88-
8974
TEST_CASE("type_identity", "[type_traits]") {
9075
STATIC_REQUIRE(std::is_same_v<stdx::type_identity_t<void>, void>);
9176
}

0 commit comments

Comments
 (0)