Category : apply

I’m trying to develop a wrapper to help people use pthread on calling any member function. template <typename> struct signature; template <typename C, typename R, typename… Args> struct signature<R (C::*)(Args…)> { using return_type = R; using pure_argument_type = std::tuple<C*, std::tuple<Args…>>; // obj, {args…} using argument_type = std::tuple<R (C::*)(Args…), pure_argument_type>; // obj.mem_fn, {obj, args…} }; struct ..

Read more

I am attempting to use concepts with a variadic template. My template class is below. The concept should say: "Each type T should have a member function Func that accepts an input of type FuncArgType." #pragma once #include <tuple> #include <concepts> #include <iostream> template<typename FuncArgType, typename… Ts> requires requires (FuncArgType func_arg, std::tuple<Ts…> args) { std::apply([&func_arg](auto&… ..

Read more