12import :compiler_signatures;
35#pragma clang diagnostic push
36#pragma clang diagnostic ignored "-Wundefined-var-template"
39template <
typename T, std::
size_t Index>
40[[nodiscard]]
consteval auto makeFieldName()
noexcept
42 static_assert(Index < fieldCount<T>,
"Field index is outside the reflected aggregate.");
44 constexpr auto wrapped = wrapPointer(std::get<Index>(pointers));
45 constexpr auto name = pointedFieldNameView<wrapped>();
46 return makeFixedString<name.size()>(name);
49template <
typename T, std::
size_t Index>
50inline constexpr auto fieldNameStorage = makeFieldName<T, Index>();
53#pragma clang diagnostic pop
59 template <
typename T, std::
size_t Index>
60 [[nodiscard]]
consteval auto fieldName()
noexcept
62 using Type = detail::ReflectedType<T>;
63 return detail::fieldNameStorage<Type, Index>;
70 "ORM_REFLECTION_FIELD_SIGNATURE_FORMAT: unsupported compiler field-signature format");
75template <
typename T, std::size_t... Indices>
76[[nodiscard]]
consteval auto makeFieldNames(std::index_sequence<Indices...>)
noexcept
78 return std::array<std::string_view,
sizeof...(Indices)>{fieldNameStorage<T, Indices>.view()...};
82inline constexpr auto fieldNamesStorage = makeFieldNames<T>(std::make_index_sequence<
fieldCount<T>>{});
84template <
typename T, std::size_t... Indices>
85[[nodiscard]]
consteval auto makeFieldDescriptors(std::index_sequence<Indices...>)
noexcept
87 return std::array<FieldDescriptor,
sizeof...(Indices)>{FieldDescriptor{
92inline constexpr auto fieldDescriptorStorage = makeFieldDescriptors<T>(std::make_index_sequence<
fieldCount<T>>{});
98 [[nodiscard]]
consteval auto fieldNames()
noexcept
100 using Type = detail::ReflectedType<T>;
101 return detail::fieldNamesStorage<Type>;
104 template <
typename T>
105 [[nodiscard]]
consteval auto fields() noexcept
107 using Type = detail::ReflectedType<T>;
108 return detail::fieldDescriptorStorage<Type>;
constexpr auto fieldPointers(T &value) noexcept
consteval auto fieldNames() noexcept
consteval auto fields() noexcept
constexpr std::size_t fieldCount
consteval auto fieldName() noexcept
constexpr auto typeNameStorage
std::string_view typeName
constexpr auto operator==(const FieldDescriptor &) const noexcept -> bool=default