24namespace bio::meta::detail
38template <
size_t capacity>
39struct literal_buffer_string : ranges::small_string<capacity>
43 constexpr literal_buffer_string(
char const (&_lit)[N]) noexcept : ranges::small_string<capacity>{_lit}
50literal_buffer_string(
char const (&)[N]) -> literal_buffer_string<N - 1>;
73 static constexpr size_t size = 0;
79 static consteval bool contains(
auto &&) {
return false; }
82 static consteval size_t index_of(
auto &&) {
return static_cast<size_t>(-1ULL); }
100 static constexpr auto value = v;
103 static constexpr size_t size = 1;
119 return (s == v) ? 0ull :
static_cast<size_t>(-1ull);
159 requires(
sizeof...(vs) >= 2)
163 static constexpr size_t size =
sizeof...(vs);
172 return ((s == vs) || ...);
180 ((vs != s && ++c) && ...);
181 return c >= size ?
static_cast<size_t>(-1ULL) : c;
185 template <
auto... v2s>
189 return vtag_t::as_tuple ==
vtag_t<v2s...>::as_tuple;
193 template <
auto... v2s>
195 requires(
sizeof...(v2s) == size && (
weakly_ordered_with<
decltype(vs),
decltype(v2s)> && ...))
197 return vtag_t::as_tuple <=>
vtag_t<v2s...>::as_tuple;
218inline namespace literals
239template <detail::literal_buffer_
string str>
240consteval auto operator""_vtag() noexcept
263template <
char... chrs>
264consteval auto operator""_vtag() noexcept
266 static_assert(((chrs >=
'0' && chrs <=
'9') && ...),
"Only integral digits supported.");
268 constexpr int64_t val = []()
constexpr
274 for (int64_t i = str.size() - 1; i >= 0; --i)
276 ret += (str[i] -
'0') * mult;
Implements a small string that can be used for compile time computations.
Definition: small_string.hpp:47
constexpr size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(begin(), end()).
Definition: small_vector.hpp:467
Provides platform and dependency checks.
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
A constexpr string implementation to manipulate string literals at compile time.