Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
EXPLICIT_INSTANTIATION.cpp
Go to the documentation of this file.
1// checking for explicit instantiation
2
3
25// IMPLICIT_INSTANTIATION.cpp depends on foo<T>(T)
26template <class T>
27T foo (T t) { return t; }
28
29template <class T>
30struct S
31{
32 T bar () {
33 // explicit instantiation of S<T> (and, consequently,
34 // S<T>::bar()) must "implicitly" instantiate foo<T>(T)
35 return foo (T ());
36 }
37};
38
39// the symbols expected to be produced by the explicit instantiation
40// directives and their attributes are as follows:
41// TEXT S<int>::bar()
42// WEAK (or TEXT) foo<int>(int)
43// TEXT S<char>::bar()
44// WEAK (or TEXT) foo<char>(char)
45
46// IMPLICIT_INSTANTIATION.cpp uses foo<int>(int)
47template class S<int>;
48template class S<char>;
#define T
Definition 17.names.cpp:163
#define t
Definition 17.names.cpp:136
#define foo(buf, s,...)