#include <tuple>
template <class... T> struct typelist { };
template <typename... ReturnTypes,
template <typename...> class T,
class ... ParameterTypes>
std::tuple<ReturnTypes...> Method(T<ReturnTypes...>,
const ParameterTypes & ... Parameters)
{
return std::tuple<ReturnTypes...>();
};
int main()
{
using ReturnTypes = typelist<int, char>;
auto t = Method(ReturnTypes{}, 10, "hello", false);
static_assert(std::is_same<decltype(t), std::tuple<int,char>>{}, "types do not match");
return 0;
}
I2luY2x1ZGUgPHR1cGxlPgoKdGVtcGxhdGUgPGNsYXNzLi4uIFQ+IHN0cnVjdCB0eXBlbGlzdCB7IH07Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUuLi4gUmV0dXJuVHlwZXMsCiAgICAgICAgICB0ZW1wbGF0ZSA8dHlwZW5hbWUuLi4+IGNsYXNzIFQsCiAgICAgICAgICBjbGFzcyAuLi4gUGFyYW1ldGVyVHlwZXM+CnN0ZDo6dHVwbGU8UmV0dXJuVHlwZXMuLi4+IE1ldGhvZChUPFJldHVyblR5cGVzLi4uPiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFBhcmFtZXRlclR5cGVzICYgLi4uIFBhcmFtZXRlcnMpCnsKICAgIHJldHVybiBzdGQ6OnR1cGxlPFJldHVyblR5cGVzLi4uPigpOwp9OwoKaW50IG1haW4oKQp7CiAgICB1c2luZyBSZXR1cm5UeXBlcyA9IHR5cGVsaXN0PGludCwgY2hhcj47CiAgICBhdXRvIHQgPSBNZXRob2QoUmV0dXJuVHlwZXN7fSwgMTAsICJoZWxsbyIsIGZhbHNlKTsKICAgIAogICAgc3RhdGljX2Fzc2VydChzdGQ6OmlzX3NhbWU8ZGVjbHR5cGUodCksIHN0ZDo6dHVwbGU8aW50LGNoYXI+Pnt9LCAidHlwZXMgZG8gbm90IG1hdGNoIik7CiAgICByZXR1cm4gMDsKfQoK