0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-01 13:18:58 +02:00

ircd::json::tuple: Use constexpr conditional in indexof() template.

This commit is contained in:
Jason Volk 2020-08-04 18:02:06 -07:00
parent 541997ab9d
commit ae65ffdcbe

View file

@ -31,12 +31,10 @@ constexpr typename std::enable_if<i < size<tuple>(), size_t>::type
indexof() indexof()
noexcept noexcept
{ {
constexpr auto equal if constexpr(name_hash(key<tuple, i>()) == hash)
{ return i;
name_hash(key<tuple, i>()) == hash
};
return equal? i : indexof<tuple, hash, i + 1>(); return indexof<tuple, hash, i + 1>();
} }
template<class tuple, template<class tuple,