|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <tuple>
|
|
|
|
|
#include <experimental/tuple>
|
|
|
|
|
|
|
|
|
|
template<class... Args1>
|
|
|
|
|
auto f(Args1... args){
|
|
|
|
|
@ -17,12 +18,12 @@ template<class... Args3>
|
|
|
|
|
//by move
|
|
|
|
|
auto q2(Args3... args){
|
|
|
|
|
return [tup=std::make_tuple(std::move(args)...)]()->decltype(auto){
|
|
|
|
|
return std::apply([](auto const&... args)->decltype(auto){
|
|
|
|
|
return std::experimental::apply([](auto const&... args)->decltype(auto){
|
|
|
|
|
return f(args...);
|
|
|
|
|
} , tup);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
template<class... Args4>
|
|
|
|
|
/*template<class... Args4>
|
|
|
|
|
//pack expansion
|
|
|
|
|
auto q3(Args4... args){
|
|
|
|
|
return [...args=std::move(args)]()->decltype(auto) {
|
|
|
|
|
@ -30,7 +31,7 @@ template<class... Args4>
|
|
|
|
|
return f(args...);
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
@ -39,6 +40,6 @@ int main()
|
|
|
|
|
|
|
|
|
|
q2(1,1);
|
|
|
|
|
|
|
|
|
|
q3(1,1);
|
|
|
|
|
//q3(1,1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|