// Glaze Library // For the license information refer to glaze.hpp #pragma once #include #include "glaze/core/common.hpp" #include "glaze/core/meta.hpp" namespace glz { namespace detail { template struct expander { static constexpr auto impl() noexcept { const auto N = glz::tuple_size_v; if constexpr (I >= N) { return Str; } else if constexpr (I == N - 1) { return expander>>, Tuple, I + 1>::value; } else { return expander>, chars<",">>, Tuple, I + 1>::value; } } static constexpr std::string_view value = impl(); }; template constexpr std::string_view expander_v = expander::value; } template concept function = is_specialization_v; template struct meta { static constexpr auto impl() noexcept { using fun = function_traits; using R = typename fun::result_type; if constexpr (fun::N == 0 && named) { return join_v, name_v, chars<"()>">>; } else if constexpr (fun::N == 0) { return chars<"std::function">; } else { return join_v, name_v, chars<"(">, detail::expander_v, typename fun::arguments>, chars<")>">>; } } static constexpr auto arr = impl(); // Give the joined string static storage static constexpr std::string_view name{arr.data(), arr.size()}; }; }