// ---------------------------------------------------------------------- // // partspec.cc - Do we support template partial specialization? // // History: // 11-Aug-1999 WEB Initial draft, adapted from Blitz++ // 25-Apr-2001 WEB s//"ISOcxx\/ISOcxxSyntax.hh"/ // // ---------------------------------------------------------------------- #include "ISOcxx/ISOcxxSyntax.hh" template< class T, int N > struct C { enum { Z = 0 }; }; // C #if ! defined DEFECT_NO_PARTIAL_SPECIALIZATION template< int N > struct C< double, N > { enum { Z = 1 }; }; // C template< class T > struct C< T, 2 > { enum { Z = 2 }; }; // C #endif // DEFECT_NO_PARTIAL_SPECIALIZATION int main() { return ( 0 != C::Z ) ? C::Z // general case #if ! defined DEFECT_NO_PARTIAL_SPECIALIZATION : ( 1 != C::Z ) ? C::Z // partial spec : ( 2 != C::Z ) ? C::Z // partial spec #endif : 0 ; } // main()