// ---------------------------------------------------------------------- // // porder.cc - Do we support partial ordering of function templates? // // History: // 16-Aug-1999 WEB Initial draft, adapted from Blitz++ // 25-Apr-2001 WEB s//"ISOcxx\/ISOcxxSyntax.hh"/ // // ---------------------------------------------------------------------- #include "ISOcxx/ISOcxxSyntax.hh" template< int N > struct I { }; template< class T > struct A { template< class T1, class T2 > int operator() ( T1 , T2 ) const { return 1; } // less specialized template< int N1, int N2 > int operator() ( I, I ) const { return 2; } // more specialized }; // A<> int main() { int result( 0 ); #if ! defined DEFECT_NO_FUNCTMPL_PARTIAL_ORDERING if ( 1 != A()( int (), float() ) ) result += 1; // less specialized if ( 2 != A()( I<1>(), I<2> () ) ) result += 2; // more specialized #endif return result; } // main()