Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
STATIC_TEMPLATE_MEMBER_INIT.cpp
Go to the documentation of this file.
1// checking initialization of static template data memebers
2
3
25template <class T>
26struct S
27{
28 static T a;
29 static T b;
30};
31
32template <class T>
33T S<T>::a; // <-- NOT initialized
34
35template <class T>
36T S<T>::b = 0; // <-- explicitly initialized
37
38int main ()
39{
40 // g++ on DEC OSF and IBM AIX fails to link
41 return S<char>::a + S<char>::b;
42}
#define T
Definition 17.names.cpp:163