repr 0.1
Reconstructable string representations and more
Loading...
Searching...
No Matches
pair.h
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <type_traits>
4
7#include "category.h"
8
9namespace librepr {
10template <typename T>
11struct Reflect;
12
13template <detail::pair_like T>
14struct Reflect<T> : category::Type<T> {
15 using type = T;
16 using first_type = typename T::first_type;
17 using second_type = typename T::second_type;
19 constexpr static bool can_descend = true;
20 constexpr static bool iterable = false;
21 constexpr static bool tuple_like = true;
22
23 template <typename V>
24 static void visit(V&& visitor, T& obj) {
27 }
28
29 template <typename V>
34};
35
36} // namespace librepr
Definition ctvi/ctvi.h:9
std::string code_for()
Definition repr:39
Reflect(T &) -> Reflect< T >
T type
Definition aggregate.h:55
static void visit(V &&visitor)
Definition pair.h:30
typename member_types::template map< librepr::Reflect > members
Definition aggregate.h:56
typename T::second_type second_type
Definition pair.h:17
static void visit(V &&visitor, T &obj)
Definition pair.h:24
typename T::first_type first_type
Definition pair.h:16
Definition reflection/reflect.h:16
Definition list.h:64
Definition category.h:49