Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
STATIC_CONST_MEMBER_EXPR_CONST.cpp
Go to the documentation of this file.
1// checking for type-dependent constant expressions
2
3
25#include "config.h"
26
27struct A { typedef int I; };
28
29template <class T>
30struct B
31{
32 typedef int I;
33 typedef typename T::I J;
34
35 static const I i = 0;
36 static const J j = 1;
37};
38
39template <class T>
40const typename B<T>::I B<T>::i;
41
42template <class T>
43const typename B<T>::J B<T>::j;
44
45template <class T>
46int foo (T)
47{
48 enum { i = B<T>::i };
49 enum { j = B<T>::j };
50
51 return i + j;
52}
53
54int bar ()
55{
56 return foo (A ());
57}
#define i
Definition 17.names.cpp:126
#define T
Definition 17.names.cpp:163
#define j
Definition 17.names.cpp:127
#define foo(buf, s,...)