Go to the source code of this file.
◆ GRAPHLE_MAKE_NIEBLOID
| #define GRAPHLE_MAKE_NIEBLOID |
( |
|
Name, |
|
|
|
Function, |
|
|
|
... |
|
) |
| |
Value:__VA_OPT__(template <) __VA_ARGS__ __VA_OPT__(>) \
struct Name##_t { \
constexpr decltype(auto) operator()(auto&&... args) const { \
return Function(GRAPHLE_FWD(args)...); \
} \
}; \
\
__VA_OPT__(template <typename... Args>) \
constexpr inline Name##_t __VA_OPT__(<Args...>) Name = {}
Constructs a Niebloid function object to wrap the provided free function. VA_ARGS may be used to pass template parameters for the function object (NOT its call operator!), e.g.:
template <typename T> auto my_transform(auto&&... args) { ... }
using alias = some_transform_t<int>;
auto result = some_transform<int>(1, 2, 3, 4);
#define GRAPHLE_MAKE_NIEBLOID(Name, Function,...)
- Note
- : NTTPs are currently not supported.
-
: If you get weird errors here using MSVC, make sure you compile with /Zc:preprocessor (The legacy preprocessor does not support VA_OPT).
Definition at line 24 of file functional.hpp.
◆ GRAPHLE_MAKE_NIEBLOID_IMPL
| #define GRAPHLE_MAKE_NIEBLOID_IMPL |
( |
|
Name, |
|
|
|
Function, |
|
|
|
... |
|
) |
| |
Value: struct Name##_t { constexpr static decltype(auto) operator()(auto&&) const {} }; \
constexpr inline Name##_t Name = {};
Simplified version of GRAPHLE_MAKE_NIEBLOID for Doxygen.
Definition at line 42 of file functional.hpp.