1 #ifndef CommonToolsUtilsExpressionEvaluatorTemplates_H 2 #define CommonToolsUtilsExpressionEvaluatorTemplates_H 12 template<
typename Ret,
typename... Args>
18 template<
typename Object>
20 virtual bool eval(Object
const&)
const = 0;
23 template<
typename Object>
25 virtual double eval(Object
const&)
const =0;
28 template<
typename Object>
31 using Mask = std::vector<bool>;
34 mask.resize(cands.size());
40 template<
typename Object>
45 cands.erase(std::remove_if(cands.begin(),cands.end(),[&](
typename Collection::value_type const &
c){
return !
f(*
c);}),cands.end());
50 template<
typename Object>
53 using Indices = std::vector<unsigned int>;
57 for (
auto const &
c : cands) {
if(
f(*
c)) inds.push_back(i); ++
i; }
65 #endif // CommonToolsUtilsExpressionEvaluatorTemplates_H std::vector< Object const * > Collection
std::vector< Object const * > Collection
void mask(Collection const &cands, Mask &mask, F f) const
Container::value_type value_type
std::vector< unsigned int > Indices
std::vector< Object const * > Collection
void select(Collection &cands, F f) const
virtual Ret operator()(Args...) const =0
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
void select(Collection const &cands, Indices &inds, F f) const