Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
PART_SPEC_OVERLOAD.cpp
Go to the documentation of this file.
1// checking partial ordering of function templates
2
3
25template <class T>
26struct S { };
27
28template <class T>
29int operator== (const T &a, const T &b)
30{
31 return a.foobar (b);
32}
33
34template <class T>
35int foo (T &a, T &b)
36{
37 return a.foobar (b);
38}
39
40template <class T>
41int operator== (const S<T>&, const S<T>&) // <-- testing
42{
43 return 1;
44}
45
46template <class T>
47int foo (S<T> &a, S<T> &b) // <-- testing
48{
49 return a == b;
50}
51
52int bar ()
53{
54 S<int> s;
55 return !(s == s && foo (s, s));
56}
#define T
Definition 17.names.cpp:163
#define a
Definition 17.names.cpp:109
#define b
Definition 17.names.cpp:110
#define s
int operator==(const T &a, const T &b)
int bar()
#define foo(buf, s,...)
void foobar()