// ---------------------------------------------------------------------- // // comppriq.cc - Do priority_queues support custom comparators? // // History: // 28-Jan-2000 WEB Initial draft, based on contpriq.cc // 21-Feb-2000 WEB Correct namespace // 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_PRIORITY_QUEUE_CONT_COMP( int , std::STL_DEQUE(int) , FunnyCompare ) pq; pq.push( 0 ); return pq.top(); } // main()