Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
NONCLASS_ARROW_RETURN.cpp
Go to the documentation of this file.
1// checking for operator->()
2
3
25struct A
26{
27 int a;
28};
29
30template<class T>
31struct B
32{
33 T* operator->() const {
34 static A a;
35 return &a;
36 }
37};
38
39
40int foo ()
41{
42 B<int> b; // <-- testing
43
44 B<A> ba;
45
46 (void)&b;
47 (void)&ba;
48
49 return ba->a;
50}
#define T
Definition 17.names.cpp:163
#define a
Definition 17.names.cpp:109
#define b
Definition 17.names.cpp:110
T * operator->() const