mirror of
https://github.com/matrix-construct/construct
synced 2024-11-19 08:21:09 +01:00
ircd::json::tuple: Use constexpr conditional in indexof() template.
This commit is contained in:
parent
541997ab9d
commit
ae65ffdcbe
1 changed files with 3 additions and 5 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue