repr
0.1
Reconstructable string representations and more
Loading...
Searching...
No Matches
visit.h
Go to the documentation of this file.
1
#pragma once
2
#include <
type_traits
>
3
4
#include <
librepr/reflection/category.h
>
5
#include <
librepr/reflection/reflect.h
>
6
7
namespace
librepr
{
8
template
<
typename
T,
typename
V>
9
void
visit
(V&&
visitor
) {
10
visitor
(
Reflect<T>
{});
11
}
12
13
template
<
typename
T,
typename
V>
14
void
visit
(V&&
visitor
, T&&
obj
) {
15
using
descend =
Reflect<std::remove_reference_t<T>
>;
16
visitor
(
category::Value<descend>
{
obj
});
17
}
18
}
// namespace librepr
category.h
librepr
Definition
ctvi/ctvi.h:9
librepr::code_for
std::string code_for()
Definition
repr:39
librepr::visit
void visit(V &&visitor)
Definition
visit.h:9
reflect.h
librepr::Reflect
Definition
reflection/reflect.h:16
librepr::category::Value
Definition
category.h:49
type_traits
include
librepr
visit.h
Generated by
1.9.8, using the excellent
Doxygen Awesome
Theme