File indexing completed on 2024-04-06 12:01:15
0001 #ifndef CommonTools_UtilAlgos_FreeFunctionSelector_h
0002 #define CommonTools_UtilAlgos_FreeFunctionSelector_h
0003
0004
0005
0006
0007
0008
0009 template <typename T, bool (*f)(const T&)>
0010 struct FreeFunctionSelector {
0011 bool operator()(const T& t) { return f(t); }
0012 };
0013
0014 #include "FWCore/Framework/interface/ConsumesCollector.h"
0015 #include "CommonTools/UtilAlgos/interface/ParameterAdapter.h"
0016
0017 namespace reco {
0018 namespace modules {
0019 template <typename T, bool (*f)(const T&)>
0020 struct ParameterAdapter<FreeFunctionSelector<T, f> > {
0021 typedef FreeFunctionSelector<T, f> value_type;
0022 static value_type make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) { return value_type(); }
0023 };
0024 }
0025 }
0026
0027 #endif