I created a set via
bool(*fn_pt)(const double&, const double&) = comp_double;
std::set<double, bool(*)(const double&, const double&) > values(fn_pt);
where my comp_double function is given by
bool comp_double (const double& p1, const double& p2)
{
return (std::abs(p1-p2)<1e-05);
}
I inserted two dummy elements, values.insert(0.01) and values.insert(0.02), but the size of my set is still zero. There are no compiler warnings or errors, so I guess the problem lies within my comp_double function. Any input would be appreciated!
Best