// ---------------------------------------------------------------------- // // compmmap.cc - Do multimaps support custom comparators? // // History: // 07-Feb-2000 WEB Initial draft, based on comppriq.cc // 21-Feb-2000 WEB Correct namespace // 04-Feb-2001 WEB Remove macro in favor of compliant code // 28-Feb-2001 WEB Reinstate macro // 25-Apr-2001 WEB s//"ISOcxx\/ISOcxxSyntax.hh"/ // // ---------------------------------------------------------------------- #include "ISOcxx/ISOcxxSyntax.hh" #include #include template< class T > struct FunnyCompare { bool operator()( T x, T y ) { return x*x < y*y; } }; // FunnyCompare int main() { std::STL_MULTIMAP_COMP( int, double, FunnyCompare ) m; m.insert( std::make_pair(0, 0.0) ); return (m.begin())->first; } // main()