Skip to content

Commit 22076b6

Browse files
dont use mlib::get_nth_element in pack_find.hpp
1 parent b8f9161 commit 22076b6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pack_find.hpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
#include<utility>
44
#include<cstddef>
55

6-
#include"get_nth_element.hpp"
7-
86
namespace mlib
97
{
8+
template<auto A, auto...B>
9+
struct first
10+
{
11+
constexpr auto operator()()
12+
{
13+
return A;
14+
}
15+
};
16+
1017
template<auto Index, auto value, auto value_two>
1118
struct value_is_value
1219
{
@@ -32,7 +39,7 @@ namespace mlib
3239
{
3340
return (value_is_value<indexes, pack, value_to_find>{}() + ...);
3441
}(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)
3643
{
3744
return -1;
3845
}

0 commit comments

Comments
 (0)