Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
etc
config
src
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)
30
template
<
class
T>
31
void
foo
(
typename
T::I,
const
T
*);
32
33
template
<
class
T>
34
struct
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)
43
template
<
class
T>
44
void
foo
(
typename
A<T>::I
,
const
A<T>
*);
45
46
template
<
class
T>
47
void
operator+
(
typename
A<T>::I
,
const
A<T>
&);
48
49
void
foo
()
50
{
51
A<int>
a
;
52
53
1 +
a
;
54
55
a
.
bar
();
56
}
57
58
59
template
<
class
T>
60
struct
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
68
void
bar
()
69
{
70
A<int>
a
;
71
B<int>
b
;
72
73
b
.
baz
(
a
,
' '
);
74
}
T
#define T
Definition
17.names.cpp:163
a
#define a
Definition
17.names.cpp:109
b
#define b
Definition
17.names.cpp:110
U
#define U
Definition
17.names.cpp:164
bar
void bar()
Definition
NONDEDUCED_CONTEXT.cpp:68
operator+
void operator+(typename A< T >::I, const A< T > &)
foo
void foo()
Definition
NONDEDUCED_CONTEXT.cpp:49
foo
#define foo(buf, s,...)
Definition
VA_LIST_FUNC_MACRO.cpp:28
A
Definition
NAMESPACE.cpp:25
B
Definition
NAMESPACE.cpp:31
A
Definition
DEFAULT_TEMPLATE_ARGS.cpp:26
A::bar
void bar()
Definition
NONDEDUCED_CONTEXT.cpp:38
A::bar
void bar(const T &=T::foobar())
Definition
INSTANTIATE_DEFAULT_ARGS.cpp:39
A::I
T I
Definition
NONDEDUCED_CONTEXT.cpp:36
B
Definition
DEFAULT_TEMPLATE_ARGS.cpp:29
B::baz
void baz(const U &, typename U::I)
Definition
NONDEDUCED_CONTEXT.cpp:64
Generated by
1.9.8