Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
extern_function_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
37template <class T>
38struct S
39{
40 T t;
41};
42
43template <class T>
45{
46#if defined (INSTANTIATE)
47 s.t = 1;
48#else // if !defined (INSTANTIATE)
49 s.t = -1;
50#endif // INSTANTIATE
51
52 return s;
53}
54
55#if defined (INSTANTIATE)
56
57template S<int> foobar (S<int>);
58
59#else // if !defined (INSTANTIATE)
60
61extern template S<int> foobar (S<int>);
62
63#endif // INSTANTIATE
#define T
Definition 17.names.cpp:163
#define t
Definition 17.names.cpp:136
#define s
void foobar()