You can use typedef

typedef bool(*p_compare)(const float, const float);
p_compare comp = compare;
std::set<float, p_compare> codes(comp);