Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
EXTERN_FUNCTION_TEMPLATE.cpp
Go to the documentation of this file.
1// checking for extern function template extension
2
3
25// include a file containing the definition of a template
26// and an extern template directive referencing an explicit
27// instantiation of the same template in extern_function_template_imp.o
28
30
31// establish a dependency on extern_function_template_imp.o to make sure
32// the extern_function_template_imp.cpp is compiled before this file
33#ifndef _RWSTD_NO_extern_function_template_imp
34
35// link with the object file below
36// LDOPTS = extern_function_template_imp.o
37
38#endif // _RWSTD_NO_extern_function_template_imp
39
40int main ()
41{
42 S<int> s;
43
44 int res = 0;
45
46 // verify that the call compiles and links
47 res += foobar (s).t;
48
49 // verify that the call resolves to the definition emitted
50 // by the explicit instantiation in extern_function_template_imp.o
51 // and not the one here
52 return !(1 == res);
53}
#define res
Definition 17.names.cpp:531
#define s
void foobar()