12#ifndef GMP_SERIALIZATION_TRAITS_HPP_
13#define GMP_SERIALIZATION_TRAITS_HPP_
37struct no_serialization_default {
38 friend constexpr bool operator==(no_serialization_default, no_serialization_default) =
default;
41inline constexpr no_serialization_default no_default{};
53 !std::same_as<std::remove_cv_t<
decltype(
Default)>, detail::no_serialization_default>;
55 template <fixed_
string Name>
consteval auto name()
const {
59 template <fixed_
string Name>
consteval auto alias()
const {
67 template <auto Value>
consteval auto defaulted()
const {
72 static_assert(std::is_invocable_v<
decltype(
Provider)>);
81 return Other::matches(
Wire.to_string_view()) ||
82 (Other::matches(
Aliases.to_string_view()) || ...);
86 constexpr std::array
names{
Wire.to_string_view(),
Aliases.to_string_view()...};
87 for (std::size_t
i = 0;
i <
names.size(); ++
i) {
88 for (std::size_t
j =
i + 1;
j <
names.size(); ++
j) {
99 if constexpr (std::is_invocable_v<
decltype(
Default)>) {
100 return static_cast<T
>(
Default());
102 return static_cast<T
>(
Default);
fixed_string(char const(&)[N]) -> fixed_string< N - 1 >
Deduce fixed_string length from a string literal.
constexpr serialization_field< Member > field
consteval auto define_schema(Fields... fields)
static constexpr auto default_provider
static constexpr bool overlaps()
static constexpr bool is_transient
consteval auto transient() const
static consteval bool names_unique()
static constexpr bool matches(std::string_view input)
static constexpr auto wire_name
consteval auto defaulted() const
consteval auto alias() const
static constexpr bool has_default
consteval auto name() const
consteval auto default_with() const
static constexpr T make_default()
static constexpr auto member