OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [variadic12.C] - Blame information for rev 320

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { dg-options "-std=gnu++0x" }
2
// A tuple type
3
template struct tuple { };
4
 
5
// Determine if two types are the same
6
template
7
struct is_same {
8
  static const bool value = false;
9
};
10
 
11
template
12
struct is_same {
13
  static const bool value = true;
14
};
15
 
16
// Append 'T' to the end of Tuple
17
template
18
struct append_to_tuple;
19
 
20
template
21
struct append_to_tuple > {
22
  typedef tuple type;
23
};
24
 
25
// Reverse a sequence of arguments (and return the result as a tuple)
26
template struct reverse;
27
 
28
template
29
struct reverse {
30
  typedef typename append_to_tuple::type>::type
31
    type;
32
};
33
 
34
template<>
35
struct reverse<> {
36
  typedef tuple<> type;
37
};
38
 
39
int a0[is_same::type, tuple<> >::value? 1 : -1];
40
int a1[is_same::type, tuple >::value? 1 : -1];
41
int a2[is_same::type, tuple >::value? 1 : -1];
42
int a3[is_same::type, tuple >::value? 1 : -1];

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.