C++ function object terminology functor, deltor, comparitor, etc..
- by Robert S. Barnes
Is there a commonly accepted terminology for various types for common functors?
For instance I found myself naturally using comparitor for comparison functors like this:
struct ciLessLibC : public std::binary_function<std::string, std::string, bool> {
bool operator()(const std::string &lhs, const std::string &rhs) const {
return strcasecmp(lhs.c_str(), rhs.c_str()) < 0 ? 1 : 0;
}
};
Or using the term deltor for something like this:
struct DeleteAddrInfo {
void operator()(const addr_map_t::value_type &pr) const {
freeaddrinfo(pr.second);
}
};
If using these kinds of shorthand terms is common, it there some dictionary of them all someplace?