You can build std::function with any object called with the appropriate arguments, and whose return value is implicitly converted to return std::function . int implicitly converted to const int& therefore rules are executed.
The compiler may be free to warn about this, but it seems like a lot of work for a particularly angular case.
TartanLlama Jan 09 '17 at 14:05 2017-01-09 14:05
source share