Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
EXPLICIT_MEMBER_INSTANTIATION.cpp
Go to the documentation of this file.
1// checking for explicit instantiation of members
2
3
25template <class T>
26T foo (T t) { return t; }
27
28template <class T>
29struct S
30{
31 T bar () const {
32 // explicit instantiation of S<T> (and, consequently,
33 // S<T>::bar()) must "implicitly" instantiate foo<T>(T)
34 return foo (T ());
35 }
36
37 static void baz (T t) {
38 foo (t);
39 }
40};
41
42template int S<int>::bar () const;
43template double S<double>::bar () const;
44
45template void S<char>::baz (char);
46template void S<unsigned>::baz (unsigned);
#define T
Definition 17.names.cpp:163
#define t
Definition 17.names.cpp:136
#define foo(buf, s,...)
static void baz(T t)