@@ -53,15 +53,7 @@ template <auto I, typename... Ts> constexpr auto index_out_of_bounds() {
53
53
} // namespace error
54
54
55
55
namespace detail {
56
- template <std::size_t , typename ...> struct element ;
57
-
58
- template <typename T>
59
- concept derivable = std::is_class_v<T>;
60
- template <typename T>
61
- concept nonderivable = not std::is_class_v<T>;
62
-
63
- template <std::size_t Index, nonderivable T, typename ... Ts>
64
- struct element <Index, T, Ts...> {
56
+ template <std::size_t Index, typename T, typename ... Ts> struct element {
65
57
#if __has_builtin(__type_pack_element)
66
58
using type = T;
67
59
#else
@@ -117,51 +109,6 @@ struct element<Index, T, Ts...> {
117
109
element const &) = default ;
118
110
};
119
111
120
- template <std::size_t Index, derivable T, typename ... Ts>
121
- struct element <Index, T, Ts...> : T {
122
- #if __has_builtin(__type_pack_element)
123
- using type = T;
124
- #else
125
- constexpr static auto ugly_Value (index_constant<Index>) -> T;
126
-
127
- [[nodiscard]] constexpr auto
128
- ugly_iGet_clvr (index_constant<Index>) const & noexcept -> T const & {
129
- return *this ;
130
- }
131
- [[nodiscard]] constexpr auto
132
- ugly_iGet_lvr (index_constant<Index>) & noexcept -> T & {
133
- return *this ;
134
- }
135
- [[nodiscard]] constexpr auto
136
- ugly_iGet_rvr (index_constant<Index>) && noexcept -> T && {
137
- return std::move (*this );
138
- }
139
- #endif
140
-
141
- template <typename U>
142
- requires (std::is_same_v<U, T> or ... or std::is_same_v<U, Ts>)
143
- [[nodiscard]] constexpr auto
144
- ugly_tGet_clvr (tag_constant<U> *) const & noexcept -> T const & {
145
- return *this ;
146
- }
147
- template <typename U>
148
- requires (std::is_same_v<U, T> or ... or std::is_same_v<U, Ts>)
149
- [[nodiscard]] constexpr auto
150
- ugly_tGet_lvr (tag_constant<U> *) & noexcept -> T & {
151
- return *this ;
152
- }
153
- template <typename U>
154
- requires (std::is_same_v<U, T> or ... or std::is_same_v<U, Ts>)
155
- [[nodiscard]] constexpr auto
156
- ugly_tGet_rvr (tag_constant<U> *) && noexcept -> T && {
157
- return std::move (*this );
158
- }
159
-
160
- constexpr auto ugly_Value_clvr () const & -> T const & { return *this ; }
161
- constexpr auto ugly_Value_lvr () & -> T & { return *this ; }
162
- constexpr auto ugly_Value_rvr () && -> T && { return std::move (*this ); }
163
- };
164
-
165
112
template <typename Op, typename Value> struct fold_helper {
166
113
Op op;
167
114
Value value;
0 commit comments