CMS 3D CMS Logo

PointerComparator.h

Go to the documentation of this file.
00001 #ifndef RecoAlgos_PointerComparator_h
00002 #define RecoAlgos_PointerComparator_h
00003 
00014 #include "FWCore/Utilities/interface/EDMException.h"
00015 
00016 template<typename C>
00017 struct PointerComparator {
00018   typedef typename C::first_argument_type first_argument_type;
00019   typedef typename C::second_argument_type second_argument_type;
00020     bool operator()( const first_argument_type * t1, const second_argument_type * t2 ) const {
00021       if ( t1 == 0 || t2 == 0 )
00022         throw edm::Exception( edm::errors::NullPointerError )
00023           << "PointerComparator: passed null pointer."; 
00024         return cmp( *t1, *t2 );
00025     }
00026   C cmp;
00027 };
00028 
00029 
00030 #endif

Generated on Tue Jun 9 17:42:43 2009 for CMSSW by  doxygen 1.5.4