Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
NONDEDUCED_CONTEXT.cpp
Go to the documentation of this file.
1// checking nondeduced context
2
3
25#include "config.h"
26
27
28// T::I is not deducible directly, but can be
29// deduced if the T in const T* can (14.8.2.4, p3)
30template <class T>
31void foo (typename T::I, const T*);
32
33template <class T>
34struct A
35{
36 typedef T I;
37
38 void bar () { foo (I (), this); }
39};
40
41// S<T>::I is not deducible directly, but can be deduced
42// if the T in the second argument can (14.8.2.4, p3)
43template <class T>
44void foo (typename A<T>::I, const A<T>*);
45
46template <class T>
47void operator+ (typename A<T>::I, const A<T>&);
48
49void foo ()
50{
51 A<int> a;
52
53 1 + a;
54
55 a.bar ();
56}
57
58
59template <class T>
60struct B
61{
62 // U::I is not deducible directly, byt can be deduced if U can
63 template <class U>
64 void baz (const U&, typename U::I) { }
65};
66
67
68void bar ()
69{
70 A<int> a;
71 B<int> b;
72
73 b.baz (a, ' ');
74}
#define T
Definition 17.names.cpp:163
#define a
Definition 17.names.cpp:109
#define b
Definition 17.names.cpp:110
#define U
Definition 17.names.cpp:164
void bar()
void operator+(typename A< T >::I, const A< T > &)
void foo()
#define foo(buf, s,...)
void bar()
void bar(const T &=T::foobar())
void baz(const U &, typename U::I)