83#ifndef LIB_META_FUNCTION_H
84#define LIB_META_FUNCTION_H
141 template<
typename FUN,
typename SEL =
void>
149 template<
typename FUN>
151 :
_Fun<decltype(&FUN::operator())>
157 template<
typename RET,
typename...ARGS>
165 enum { ARITY =
sizeof...(ARGS) };
169 template<
typename RET,
typename...ARGS>
175 template<
typename SIG>
181 template<
typename SIG>
187 template<
typename SIG>
193 template<
typename SIG>
199 template<
class C,
typename RET,
typename...ARGS>
205 template<
class C,
typename RET,
typename...ARGS>
213 template<
class C,
typename RET,
typename...ARGS>
219 template<
class C,
typename FUN>
235 template<
typename RET,
typename ARGS>
238 template<
typename RET,
typename...ARGS>
252 template<
typename FUN>
256 template<
typename FUN>
259 static_assert(
_Fun<FUN>() ,
"something funktion-like required");
260 static_assert(
_Fun<FUN>::ARITY == 1 ,
"function with exactly one argument required");
268 template<
typename FUN>
269 using _FunArg = _DetectSingleArgFunction<FUN>::Arg;
273 template<
typename FUN, u
int a>
274 using has_Arity = std::bool_constant<_Fun<FUN>::ARITY == a>;
276 template<
typename FUN>
279 template<
typename FUN>
282 template<
typename FUN>
285 template<
typename FUN>
302 : std::is_same<SIG, typename _Fun<FUN>::Sig>
306 template<
typename FUN,
typename X>
316#define ASSERT_VALID_SIGNATURE(_FUN_, _SIG_) \
317 static_assert (lib::meta::has_Sig<_FUN_, _SIG_>::value, \
318 "Function " STRINGIFY(_FUN_) " unsuitable, expected signature: " STRINGIFY(_SIG_));
330 template<
typename SIG,
typename FUN>
331 constexpr inline auto
342#define ASSERT_MEMBER_FUNCTOR(_EXPR_, _SIG_) \
343 static_assert (lib::meta::isFunMember<_SIG_>(_EXPR_), \
344 "Member " STRINGIFY(_EXPR_) " unsuitable, expect function signature: " STRINGIFY(_SIG_));
360 template<
class W,
class TAR>
361 constexpr inline TAR*
364 return static_cast<TAR*
> (&instance);
368 template<
class W,
typename X>
385 template<
class W,
class TUP>
386 constexpr inline auto
389 auto splice = [&instance](
auto&& ...xs)
391 return std::tuple{maybeInject (instance, std::move(
xs))...};
393 return std::apply (
splice, std::forward<TUP> (invocation));
Implementation namespace for support and library code.
A template metaprogramming technique for manipulating collections of types.