A type with a call operator is a FunctionObject, and thus a Callable type. The call operator can have any parameters and return type, and can be defined inside or outside a class.
Sometimes you need to define it yourself, like when providing a Compare to std::set, or Hash and key eq. predicate to std::unordered_map:
struct compare_abs {
bool operator()(int x, int y) const {
return std::abs(x) < std::abs(y);
}
};
// ordered set containing {2, 3, -7}
std::set<int, compare_abs> s{-7, 2, 3, -2};
std::set<int, decltype([](int x, int y) {
return std::abs(x) < std::abs(y);
})> s;