thesis version

This commit is contained in:
2021-05-10 18:14:24 +02:00
commit caf2a692f9
281 changed files with 73182 additions and 0 deletions

View File

@ -0,0 +1,50 @@
#ifndef ALSK_ALSK_SKELETON_MUSCLE_MUSCLE_H
#define ALSK_ALSK_SKELETON_MUSCLE_MUSCLE_H
#include <tmp/pack.h>
namespace alsk {
/**
* @brief hold the functionoid type and its links
*/
template<typename Type, typename Links>
using Fun = tmp::Pack<Type, Links>;
}
template<typename T, T> struct Fn;
template<typename R, typename... Ts, R(*F)(Ts...)>
struct Fn<R(*)(Ts...), F> {
using Signature = R(Ts...);
constexpr R operator()(Ts... args) { return F(args...); }
};
template<typename R, typename... Ts, R(&F)(Ts...)>
struct Fn<R(&)(Ts...), F> {
using Signature = R(Ts...);
constexpr R operator()(Ts... args) { return F(args...); }
};
#define FN(f) Fn<decltype(f)&, f>
#define FN_OVERLOAD(T, f) Fn<T, f>
/** C++17
* namespace impl {
*
* template<typename T, T> struct Fn;
*
* template<typename R, typename... Ts, R(*F)(Ts...)>
* struct Fn<R(*)(Ts...), F> {
* R operator()(Ts... args) { return F(args...); }
* };
*
* }
*
* template<auto F>
* using Fn = impl::Fn<decltype(F), F>;
*/
#endif