We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
mlib::get_nth_element
pack_find.hpp
1 parent b8f9161 commit 22076b6Copy full SHA for 22076b6
pack_find.hpp
@@ -3,10 +3,17 @@
3
#include<utility>
4
#include<cstddef>
5
6
-#include"get_nth_element.hpp"
7
-
8
namespace mlib
9
{
+ template<auto A, auto...B>
+ struct first
10
+ {
11
+ constexpr auto operator()()
12
13
+ return A;
14
+ }
15
+ };
16
+
17
template<auto Index, auto value, auto value_two>
18
struct value_is_value
19
@@ -32,7 +39,7 @@ namespace mlib
32
39
33
40
return (value_is_value<indexes, pack, value_to_find>{}() + ...);
34
41
}(std::make_index_sequence<sizeof...(pack)>{});
35
- if constexpr (x == 0 && mlib::get_nth_element<0>(pack...) != value_to_find)
42
+ if constexpr ((x == 0) && mlib::first<pack...>{}() == value_to_find)
36
43
37
44
return -1;
38
45
}
0 commit comments