repr 0.1
Reconstructable string representations and more
Loading...
Searching...
No Matches
custom.h
Go to the documentation of this file.
1#pragma once
2#include <string>
3
6
7
8namespace librepr {
9template <typename T>
10struct Reflect;
11
12//TODO this shouldn't be a specialization of Reflect
15/*template <typename T>
16 requires has_custom_members<T>
17struct Reflect<T> {
18 using type = T;
19 using members = typename Settings<T>::members;
20
21 static_assert(members::template is_valid_for<T>, "Members visit the wrong class type.");
22
23 template <typename V>
24 static void visit(V&& visitor, T const& obj) {
25 Visit::type<T>(visitor);
26 ScopeGuard guard{visitor};
27
28 members::for_each([&visitor, &obj]<Member member> {
29 constexpr static auto name = detail::custom_member_name<member>();
30 if constexpr (!name.empty()){
31 Visit::member_name(visitor, std::string_view{name});
32 }
33 Reflect<typename decltype(member)::type>::visit(visitor, member(obj));
34 });
35 }
36};*/
37} // namespace librepr
Definition ctvi/ctvi.h:9
Reflect(T &) -> Reflect< T >