Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic5.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// PR c++/65949 // { dg-do compile { target c++14 } } #include <initializer_list> template<class T, class... Ts> struct Over : T, Over<Ts...>::type { using type = Over; Over(T f1, Ts... f2) : T(f1), Over<Ts...>::type(f2...) { } using T::operator(); using Over<Ts...>::type::operator(); }; template<class T> struct Over<T> : T { using type = T; using T::operator(); }; template <class... Lambdas> auto CreateLambdas(Lambdas... lambdas) { return Over<Lambdas...>(lambdas...); } int main() { auto mesLambda = CreateLambdas ( []() { }, [](auto i) { (void)i; }, [](auto... args) { auto list = {args...}; for(auto &&a : list) (void)a; return 3; } ); mesLambda(); mesLambda(1); mesLambda(12,24,36,48); }