8#include "fixed_string.hpp"
16namespace hi::inline v1 {
18template<basic_fixed_string Head, basic_fixed_string... Tail>
21 if constexpr (
sizeof...(Tail) > 0) {
22 return index == 0 ? Head : tag_at_index_impl<Tail...>(index - 1);
31template<basic_fixed_string... Tags>
34 if constexpr (
sizeof...(Tags) > 0) {
35 return tag_at_index_impl<Tags...>(index);
41template<basic_fixed_string Head, basic_fixed_string... Tail>
44 if constexpr (
sizeof...(Tail) > 0) {
45 return tag == Head ? index : index_of_tag_impl<Tail...>(tag, index + 1);
47 return tag == Head ? index : index + 1;
54template<basic_fixed_string... Tags>
57 if constexpr (
sizeof...(Tags) > 0) {
58 return index_of_tag_impl<Tags...>(tag, 0);
64template<basic_fixed_string Needle, basic_fixed_string Head, basic_fixed_string... Tail>
67 if constexpr (
sizeof...(Tail) > 0) {
68 return Needle == Head ? index : index_of_tag_impl<Needle, Tail...>(index + 1);
70 return Needle == Head ? index : index + 1;
77template<basic_fixed_string Needle, basic_fixed_string... Haystack>
80 if constexpr (
sizeof...(Haystack) > 0) {
81 return index_of_tag_impl<Needle, Haystack...>(0);
87template<basic_fixed_string Needle, basic_fixed_string... Haystack>
88constexpr bool has_tag() noexcept
90 return index_of_tag<Needle, Haystack...>() <
sizeof...(Haystack);
93template<basic_fixed_string... Haystack>
96 return index_of_tag<Haystack...>(needle) <
sizeof...(Haystack);