FastLED 3.9.15
Loading...
Searching...
No Matches
function_traits.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/stdint.h"
4#include "fl/stl/tuple.h"
5
6namespace fl {
7
8// =============================================================================
9// Function signature traits - extract return type and argument types
10// =============================================================================
11
12template <typename T>
14
15// For free functions
16template <typename R, typename... Args>
17struct function_traits<R(Args...)> {
18 using return_type = R;
19 using args_tuple = fl::tuple<Args...>;
20 static constexpr fl::size arity = sizeof...(Args);
21
22 template <fl::size N>
24};
25
26// For function pointers
27template <typename R, typename... Args>
28struct function_traits<R(*)(Args...)> : function_traits<R(Args...)> {};
29
30// For fl::function
31template <typename R, typename... Args>
32struct function_traits<fl::function<R(Args...)>> : function_traits<R(Args...)> {};
33
34} // namespace fl
Base definition for an LED controller.
Definition crgb.hpp:179
typename fl::tuple_element< N, args_tuple >::type arg
static constexpr fl::size arity