capydi
Loading...
Searching...
No Matches
Template.hpp
Go to the documentation of this file.
1#ifndef UNIFY_TEMPLATE_HPP_
2#define UNIFY_TEMPLATE_HPP_
3
6
7#include <array>
8
9namespace capy::meta
10{
11
12template<
13 template<typename...> typename Template,
14 MetaArity REQUIRED_ARITY,
15 MetaArity... OPTIONAL_ARITIES
16>
18{
19public:
20 static constexpr std::array META_CALLABLE_TAGS = {
22 };
23
24 static constexpr std::array META_CALLABLE_ARITIES = {
25 REQUIRED_ARITY,
26 OPTIONAL_ARITIES...
27 };
28
29public:
30 template<typename... Args>
31 struct Functor
32 {
33 using type = typename Template<Args...>::type;
34 };
35};
36
37template<
38 template<typename...> typename Template,
39 MetaArity REQUIRED_ARITY,
40 MetaArity... OPTIONAL_ARITIES
41>
43{
44public:
49
50 static constexpr std::array META_CALLABLE_ARITIES = {
51 REQUIRED_ARITY,
52 OPTIONAL_ARITIES...
53 };
54
55public:
56 template<typename... Args>
57 struct Functor
58 {
59 public:
60 static constexpr auto
61 value = Template<Args...>::value;
62
63 public:
64 using type = decltype(value);
65 };
66};
67
68}
69
70#endif // !UNIFY_TEMPLATE_HPP_
Definition Rebind.hpp:7
MetaArity
Definition MetaArity.hpp:11
@ VALUE_CALLABLE
Definition Trait.hpp:15
@ TYPE_CALLABLE
Definition Trait.hpp:14
Definition Template.hpp:32
typename Template< Args... >::type type
Definition Template.hpp:33
Definition Template.hpp:18
static constexpr std::array META_CALLABLE_ARITIES
Definition Template.hpp:24
static constexpr std::array META_CALLABLE_TAGS
Definition Template.hpp:20
Definition Template.hpp:58
decltype(value) type
Definition Template.hpp:64
static constexpr auto value
Definition Template.hpp:61
Definition Template.hpp:43
static constexpr std::array META_CALLABLE_TAGS
Definition Template.hpp:45
static constexpr std::array META_CALLABLE_ARITIES
Definition Template.hpp:50