Skip to content
Snippets Groups Projects
PawianCollectionUtils.hh 554 B
Newer Older
Bertram Kopf's avatar
Bertram Kopf committed
#include <algorithm>
#include <boost/shared_ptr.hpp>

namespace pawian {
  namespace Collection {
    struct PtrLess {
      template<class PtrType>
Bertram Kopf's avatar
Bertram Kopf committed
      bool operator()(PtrType ptr1, PtrType ptr2) const {
        return (*ptr1) < (*ptr2);
      }
    };
Bertram Kopf's avatar
Bertram Kopf committed
    struct SharedPtrLess {
      template<class PtrType>
      bool operator()(boost::shared_ptr<PtrType> shptr1, 
		      boost::shared_ptr<PtrType> shptr2) const {
Bertram Kopf's avatar
Bertram Kopf committed
	PtrType* ptr1=shptr1.get();
	PtrType* ptr2=shptr2.get();
        return (*ptr1) < (*ptr2);
      }
    };
  }