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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [variadic-lambda.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-options "-std=c++0x" }
2
 
3
struct int_placeholder;
4
 
5
template
6
struct do_replace
7
{
8
  typedef T type;
9
};
10
 
11
template<>
12
struct do_replace
13
{
14
  typedef int type;
15
};
16
 
17
template struct lambdalike
18
{
19
  typedef T type;
20
};
21
 
22
template class TT, typename... Args>
23
struct lambdalike > {
24
  typedef TT::type...> type;
25
};
26
 
27
 
28
template
29
struct is_same
30
{
31
  static const bool value = false;
32
};
33
 
34
template
35
struct is_same
36
{
37
  static const bool value = true;
38
};
39
 
40
template struct tuple;
41
template struct pair;
42
 
43
static_assert(is_same>::type,
44
                      tuple>::value,
45
              "MPL lambda-like replacement on tuple");
46
static_assert(is_same>::type,
47
                      pair>::value,
48
              "MPL lambda-like replacement on pair");
49
 
50
 
51
struct _1 {};
52
 
53
template
54
struct eval
55
{
56
    typedef Lambda type;
57
};
58
 
59
template
60
struct eval
61
{
62
    typedef Arg0 type;
63
};
64
 
65
template class T, typename... Pack>
66
struct eval >
67
{
68
    typedef T< typename eval::type... > type;
69
};
70
 
71
static_assert(is_same>::type,
72
                      tuple>::value, "eval tuple");
73
static_assert(is_same>::type,
74
                      pair>::value, "eval pair");
75
static_assert(is_same
76
                           tuple, pair,
77
                                 pair>>::type,
78
              tuple, pair, pair>>::value,
79
              "recursive eval");

powered by: WebSVN 2.1.0

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