system
The vocabulary types everything else shares
Loading...
Searching...
No Matches
Lambdify.hpp
Go to the documentation of this file.
1
8// Lambdify.hpp
16//todo could be great to add a c++11 version ("template<auto Func>" is forcing minimum c++17)
17
18#pragma once
19
20#include <utility>
21#include <type_traits>
22
23// wrapper stateless générique
24template<auto Func>
25struct lambdify {
26 // type par défaut
27 struct type {
28 constexpr type() = default; // default-constructible
29
30 // opérateur () qui forward les arguments vers la fonction réelle
31 template<typename... Args>
32 constexpr auto operator()(Args&&... args) const
33 -> decltype(Func(std::forward<Args>(args)...))
34 {
35 return Func(std::forward<Args>(args)...);
36 }
37 };
38};
39
40// Helper alias
41template<auto Func>
constexpr T epsilon_v
Definition Constants.hpp:32
typename lambdify< Func >::type lambdify_t
Definition Lambdify.hpp:42
Definition Lambdify.hpp:27
constexpr auto operator()(Args &&... args) const -> decltype(Func(std::forward< Args >(args)...))
Definition Lambdify.hpp:32
constexpr type()=default
Definition Lambdify.hpp:25