#ifndef PK_PKTMPLN_H #define PK_PKTMPLN_H #if defined (__cplusplus) #include template struct pk_tmpln_1 { using FuncType = std::function; FuncType func; static Ret invoke(void *ptr, B1 b1) { auto *self = static_cast(ptr); return self->func(reinterpret_cast(b1)); } }; template struct pk_tmpln_2 { using FuncType = std::function; FuncType func; static Ret invoke(void *ptr, B1 b1, B2 b2) { auto *self = static_cast(ptr); return self->func(reinterpret_cast(b1), reinterpret_cast(b2)); } }; template struct pk_tmpln_3 { using FuncType = std::function; FuncType func; static Ret invoke(void *ptr, B1 b1, B2 b2, B3 b3) { auto *self = static_cast(ptr); return self->func(reinterpret_cast(b1), reinterpret_cast(b2), reinterpret_cast(b3)); } }; #endif #endif /* PK_PKTMPLN_H */