8#include "utility/module.hpp"
16namespace hi::inline
v1 {
18template<fixed_string Head, fixed_string... Tail>
21 if constexpr (
sizeof...(Tail) > 0) {
22 return index == 0 ? Head : tag_at_index_impl<Tail...>(index - 1);
31template<fixed_string... Tags>
34 if constexpr (
sizeof...(Tags) > 0) {
35 return tag_at_index_impl<Tags...>(index);
41template<fixed_string Head, 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<fixed_string... Tags>
57 if constexpr (
sizeof...(Tags) > 0) {
58 return index_of_tag_impl<Tags...>(tag, 0);
64template<fixed_string Needle, fixed_string Head, 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<fixed_string Needle, fixed_string... Haystack>
80 if constexpr (
sizeof...(Haystack) > 0) {
81 return index_of_tag_impl<Needle, Haystack...>(0);
87template<fixed_string Needle, fixed_string... Haystack>
88constexpr bool has_tag() noexcept
90 return index_of_tag<Needle, Haystack...>() <
sizeof...(Haystack);
93template<fixed_string... Haystack>
96 return index_of_tag<Haystack...>(needle) <
sizeof...(Haystack);
DOXYGEN BUG.
Definition algorithm.hpp:13
std::size_t index_of_tag(std::string tag) noexcept
Definition tag.hpp:55
std::string tag_at_index(std::size_t index) noexcept
Definition tag.hpp:32