Add __traits(canCall) and __traits(resolve)

Dom DiSc dominikus at scherkl.de
Sun Jul 27 11:37:38 UTC 2025


On Saturday, 26 July 2025 at 02:27:08 UTC, Steven Schveighoffer 
wrote:
> Just having run into the problem of `__traits(compiles)` 
> swallowing unexpected errors for the umpteenth time, I'm 
> wondering if we can formally get this feature into the language.
[...]

> What I'd like to see are 2 traits calls.
>
> `__traits(canCall, expression)`
[...]
> `__traits(resolve, expression)`
[...]

> What this is saying is "give me the thing you would call if I 
> wrote this expression".
>
> These kinds of questions can be answered by the compiler, but 
> we have no way of asking them in a satisfactory way.

Yes, nice idea. I often wished something like this would be 
possible.



More information about the dip.ideas mailing list