1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <tuple> #include <array> template <class A1, class A2> struct ArrayHolder; template <class ...A1, class ...A2> struct ArrayHolder<std::tuple<A1...>, std::tuple<A2...> > { std::array<int, sizeof...(A1)> a; std::array<int, sizeof...(A2)> b; ArrayHolder(A1 ...a, A2 ...b): a({a...}), b({b...}) {} }; ArrayHolder<std::tuple<int, int>, std::tuple<int, int, int> > x(1, 2, 3, 4, 5); |
I2luY2x1ZGUgPHR1cGxlPgojaW5jbHVkZSA8YXJyYXk+CiAKdGVtcGxhdGUgPGNsYXNzIEExLCBjbGFzcyBBMj4Kc3RydWN0IEFycmF5SG9sZGVyOwogCnRlbXBsYXRlIDxjbGFzcyAuLi5BMSwgY2xhc3MgLi4uQTI+CnN0cnVjdCBBcnJheUhvbGRlcjxzdGQ6OnR1cGxlPEExLi4uPiwgc3RkOjp0dXBsZTxBMi4uLj4gPgp7CiAgICBzdGQ6OmFycmF5PGludCwgc2l6ZW9mLi4uKEExKT4gYTsKICAgIHN0ZDo6YXJyYXk8aW50LCBzaXplb2YuLi4oQTIpPiBiOwogICAgQXJyYXlIb2xkZXIoQTEgLi4uYSwgQTIgLi4uYik6IAogICAgICAgIGEoe2EuLi59KSwgYih7Yi4uLn0pIHt9ICAgCn07CiAKQXJyYXlIb2xkZXI8c3RkOjp0dXBsZTxpbnQsIGludD4sIHN0ZDo6dHVwbGU8aW50LCBpbnQsIGludD4gPiB4KDEsIDIsIDMsIDQsIDUpOw==
prog.cpp:12:33: error: parameter packs must be at the end of the parameter list prog.cpp:13: confused by earlier errors, bailing out
-
result: Compilation error (maybe you wish to see an example for C++11)


