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
FRIEND_TEMPLATE.cpp
Go to the documentation of this file.
1
// checking for friend templates of templates
2
3
25
#include "config.h"
26
27
28
template
<
class
T>
29
struct
A
{
enum
{
i
}; };
30
31
template
<
class
T>
32
struct
B
33
{
34
private
:
35
36
template
<
class
U,
class
V>
37
friend
int
foo
(
A<U>
,
B<V>
);
38
39
int
bar
(
int
i
)
const
{
return
i
; }
40
};
41
42
template
<
class
T,
class
U>
43
int
foo
(
A<T>
a
,
B<U>
b
)
44
{
45
return
b
.bar (
a
.i);
46
}
47
48
#ifndef _RWSTD_NO_EXPLICIT_FUNC_INSTANTIATION
49
50
// explicitly instantiate to detect bugs such as SunPro 5.3's PR #30227
51
template
int
foo
(
A<int>
,
B<double>
);
52
53
#endif
// _RWSTD_NO_EXPLICIT_FUNC_INSTANTIATION
54
55
int
baz
()
56
{
57
A<int>
a
;
58
B<double>
b
;
59
60
return
foo
(
a
,
b
);
61
}
i
#define i
Definition
17.names.cpp:126
a
#define a
Definition
17.names.cpp:109
b
#define b
Definition
17.names.cpp:110
bar
int bar()
Definition
collapse_static_locals.lib.cpp:36
baz
int baz()
Definition
FRIEND_TEMPLATE.cpp:55
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
B
Definition
DEFAULT_TEMPLATE_ARGS.cpp:29
B::foo
friend int foo(A< U >, B< V >)
Generated by
1.9.8