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
extern_template_imp.h
Go to the documentation of this file.
1
2
24
// avoid including <config.h> here to avoid inadvertently
25
// trying to introduce dependencies on other config tests
26
// that the config infrastructure won't know about (since
27
// it only searches .cpp files for them)
28
// #include <config.h>
29
30
#if __GNUG__ >= 3
31
// disable gcc 3.x (and beyond) error: ISO C++ forbids the use
32
// of `extern' on explicit instantiations
33
# pragma GCC system_header
34
#endif
// gcc >= 3
35
36
37
template
<
class
T>
38
struct
S
39
{
40
T
t
;
41
42
T
foo
()
const
;
43
44
T
bar
()
const
;
45
46
T
baz
()
const
{
47
return
bar
();
48
}
49
50
template
<
class
U>
51
U
inline_member_template
(
U
)
const
{
52
return
U
();
53
}
54
55
template
<
class
U>
56
U
member_template
(
U
)
const
;
57
};
58
59
template
<
class
T>
60
inline
T
S<T>::bar
()
const
61
{
62
return
foo
();
63
}
64
65
template
<
class
T>
66
T
S<T>::foo
()
const
67
{
68
#if defined (INSTANTIATE)
69
return
1;
70
#else
// if !defined (INSTANTIATE)
71
return
0;
72
#endif
// INSTANTIATE
73
}
74
75
template
<
class
T>
76
template
<
class
U>
77
U
S<T>::member_template
(
U
)
const
78
{
79
return
U
();
80
}
81
82
83
#if defined (INSTANTIATE)
84
85
template
struct
S<int>
;
86
87
#else
// if !defined (INSTANTIATE)
88
89
extern
template
struct
S<int>
;
90
91
#endif
// INSTANTIATE
T
#define T
Definition
17.names.cpp:163
t
#define t
Definition
17.names.cpp:136
U
#define U
Definition
17.names.cpp:164
bar
int bar()
Definition
collapse_static_locals.lib.cpp:36
foo
#define foo(buf, s,...)
Definition
VA_LIST_FUNC_MACRO.cpp:28
S
Definition
COLLAPSE_TEMPLATE_STATICS.cpp:40
S::baz
T baz() const
Definition
extern_template_imp.h:46
S::inline_member_template
U inline_member_template(U) const
Definition
extern_template_imp.h:51
S::foo
T foo() const
Definition
extern_template_imp.h:66
S::member_template
U member_template(U) const
Definition
extern_template_imp.h:77
S::bar
T bar() const
Generated by
1.9.8