Arduino Helpers
master
Utility library for Arduino
src
AH
Types
FunctionTraits.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <AH/STL/cstddef>
4
#include <AH/STL/tuple>
5
6
#include <
AH/Settings/NamespaceSettings.hpp
>
7
8
BEGIN_AH_NAMESPACE
9
10
template
<
class
T>
11
struct
function_traits
;
12
13
template
<
class
Return,
class
... Args>
14
struct
function_traits
<Return(Args...)> {
15
static
constexpr
size_t
number_arguments =
sizeof
...(Args);
16
17
using
return_t
= Return;
18
template
<
size_t
Index>
19
struct
argument {
20
using
type
=
21
typename
std::tuple_element<Index, std::tuple<Args...>>::type;
22
};
23
24
template
<
size_t
Index>
25
using
argument_t
=
typename
argument<Index>::type
;
26
};
27
28
END_AH_NAMESPACE
NamespaceSettings.hpp
END_AH_NAMESPACE
#define END_AH_NAMESPACE
Definition:
NamespaceSettings.hpp:14
BEGIN_AH_NAMESPACE
#define BEGIN_AH_NAMESPACE
Definition:
NamespaceSettings.hpp:11
function_traits< Return(Args...)>::argument::type
typename std::tuple_element< Index, std::tuple< Args... > >::type type
Definition:
FunctionTraits.hpp:21
function_traits< Return(Args...)>::argument_t
typename argument< Index >::type argument_t
Definition:
FunctionTraits.hpp:25
function_traits< Return(Args...)>::return_t
Return return_t
Definition:
FunctionTraits.hpp:17
function_traits
Definition:
FunctionTraits.hpp:11
Generated by
1.9.4