Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp0x/variadic-tuple2.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 // PR c++/67164 | |
2 // { dg-do compile { target c++11 } } | |
3 | |
4 #include <type_traits> | |
5 | |
6 namespace detail { | |
7 template <bool ...b> | |
8 struct fast_and | |
9 : std::is_same<fast_and<b...>, fast_and<(b, true)...>> | |
10 { }; | |
11 } | |
12 | |
13 template <typename ...Xn> | |
14 struct tuple { | |
15 tuple() { } | |
16 | |
17 template <typename ...Yn, typename = typename std::enable_if< | |
18 detail::fast_and<std::is_constructible<Xn, Yn&&>::value...>::value | |
19 >::type> | |
20 tuple(Yn&& ...yn) { } | |
21 | |
22 template <typename ...Yn, typename = typename std::enable_if< | |
23 detail::fast_and<std::is_constructible<Xn, Yn const&>::value...>::value | |
24 >::type> | |
25 tuple(tuple<Yn...> const& other) { } | |
26 }; | |
27 | |
28 tuple<tuple<>> t{}; | |
29 tuple<tuple<>> copy = t; |