-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathStrategy.h
executable file
·63 lines (45 loc) · 1.24 KB
/
Strategy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef AETHER_STRATEGY_H
#define AETHER_STRATEGY_H
#include <boost/hana.hpp>
#include <boost/optional.hpp>
using namespace boost;
#include "aether/fwd/TypeTraits.h"
#include "aether/fwd/RandomSequence.h"
#include "aether/Sampler.h"
namespace aether {
template <std::size_t I>
struct ignore {
template <typename T>
constexpr ignore(T&&) {}
};
template <typename Indices>
struct extract_impl;
template <std::size_t... Is>
struct extract_impl<std::index_sequence<Is...>> {
template <typename T, typename... Ts>
static decltype(auto) apply(ignore<Is>..., T&& t, Ts&&...) {
return std::forward<T>(t);
}
};
template <std::size_t I, typename... Ts>
decltype(auto) extract(Ts&&... ts) {
return extract_impl<std::make_index_sequence<I>>::apply(std::forward<Ts>(ts)...);
}
template <typename T>
struct node_traits_t;
template <typename T>
struct Node;
template <typename T>
struct node_traits_t {
using args_t = fn_args_t<T>;
Ty<args_t> s{};
template <typename Args>
struct unpack_args;
template <typename... Args>
struct unpack_args<TypeList<Args...>> {
using return_t = decltype(std::declval<T>()(std::declval<Args>()...));
};
using return_t = typename unpack_args<args_t>::return_t;
};
} // end namespace aether
#endif