aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr33955.C
blob: 7d3f6b6649e230f317870ade01523f90fabccdce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// { dg-do compile { target c++11 } }
template<typename T>
struct uncvref
{
  typedef T type;
};

template<typename... Args>
struct args
{
  static const int size = sizeof...(Args);
};

template<typename G, typename E, typename S, typename V, long GN = G::size, long EN = E::size>
struct apply_args;

template<typename... G, typename... E, typename S, typename V, long N>
struct apply_args<args<G...>, args<E...>, S, V, N, N>
{
  typedef args<
    typename G::template apply<typename uncvref<E>::type, S, V>::type...
    > type;
};

struct or_
{
  template<typename E, typename S, typename V>
  struct apply {
    typedef typename E::type type;
  };
};

template<typename T>
struct identity
{
  typedef T type;
};

apply_args<args<or_>, args<identity<int>>, float, double> a1;