[Issue 20246] isCallable fails for template opCall overload
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Sep 28 15:30:04 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20246
--- Comment #5 from Paul Backus <snarwin+bugzilla at gmail.com> ---
(In reply to Max Samukha from comment #3)
> That does not take into account rvalue-ness of the arguments:
>
> void foo(ref int) {}
> store
> static if (isCallableWith!(typeof(1)))
> foo(1); // error
>
> isCallableWith would have to accept the actual arguments, (type,
> rvalue-ness) pairs, or both.
Then perhaps the best solution is to add a note to the documentation of
isCallable highlighting its shortcomings, and encourage everyone to instead use
__traits(compiles) directly with the actual function call they want to make.
--
More information about the Digitalmars-d-bugs
mailing list