Add __traits(canCall) and __traits(resolve)
Steven Schveighoffer
schveiguy at gmail.com
Tue Jul 29 14:48:48 UTC 2025
On Tuesday, 29 July 2025 at 04:28:44 UTC, Richard (Rikki) Andrew
Cattermole wrote:
> Something I've wanted for along time now, to speed up
> reflection is the offering to filter symbols.
>
> ```d
> __traits(filterFunctionByTypes, source, Return, Parameters...)
> ```
>
> Where ``source`` could be a type, alias (overload set), named
> import ext.
>
> Where ``Return`` could be ``auto`` to mean "don't care".
>
> But also:
>
> ```d
> __traits(filterFunctionByExpression, source, args...)
> ```
>
> The result of both is an alias sequence of symbols.
This is a tough one to implement, because of the auto thing. Is
there a reason you need to avoid passing actual types?
This also doesn't seem to be designed to handle templates?
-Steve
More information about the dip.ideas
mailing list