// ---------------------------------------------------------------------- // // tmplstat.cc - Do we support templated static data members? // // History: // 27-Sep-1999 WEB Initial draft, adapted from STLport // 25-Apr-2001 WEB s//"ISOcxx\/ISOcxxSyntax.hh"/ // // ---------------------------------------------------------------------- #include "ISOcxx/ISOcxxSyntax.hh" // ---------------------------------------------------------------------- // define a generic class with a static member: // ---------------------------------------------------------------------- template< class T > struct C { #if ! defined DEFECT_NO_STATIC_TEMPLATE_DATA /* compliant */ static int i; #endif }; // C // ---------------------------------------------------------------------- // define the templated statics: // ---------------------------------------------------------------------- #if ! defined DEFECT_NO_STATIC_TEMPLATE_DATA /* compliant */ template< class T > int C::i = 0; #endif // ---------------------------------------------------------------------- // test driver: // ---------------------------------------------------------------------- int main() { #if ! defined DEFECT_NO_STATIC_TEMPLATE_DATA /* compliant */ return C::i; #else /* defective */ return 0; #endif } // main()