Actually, there are two questions here:
- Why is conversion allowed ?
- Why if no argument is provided to
bind
, the return object accepts any number of argument ?
The former is just a decision on the behavior of bind
: since you can call TakesChar(1.1f)
why not allow std::bind(&TakesChar, _1)
to bind to std::function<void(float)>
? The committee decided to allow it.
The latter, as explained in comments, was already addressed on SO. In short, not only is it easier, it also allows to bind
an object that has multiple operator()
of different arities.