I have read some boost::thread code and found a lot of overloads of operator() in a struct. For instance, in boost/thread/thread_functors.hpp, you can see something like this:
struct detach
{
void operator()(thread& t)
{
t.detach();
}
};
I don't understand what the benefits are. Why not use functions like
void detach(thread& t) {...}
instead?