On 2018-09-11 08:53, Sarfaraz Nawaz wrote:
> Anyway, it seems it'd be good if the core language allows passing `type` as
> argument to a function, as the compiler should be able to create a callable
> entity out of this so that the following could be allowed:
>
> std::any_of(begin(x), end(x), bool);
>
> and from the third argument, the compiler should create a function that
> takes zero or more arguments (templatized) and returns bool
That seems... overly involved for a language feature of somewhat
questionable value (*as* a language feature).
Wouldn't it be much simpler to have:
std::any_of(begin(x), end(x), std::cast<bool>);
...? And can't we already implement that?
--
Matthew