is(x = module) vs. __traits(isModule, x)

Nick Treleaven nick at geany.org
Sun Oct 11 11:30:00 UTC 2020


On Thursday, 8 October 2020 at 13:04:18 UTC, Stefan Koch wrote:
> On Thursday, 8 October 2020 at 12:54:49 UTC, Adam D. Ruppe 
> wrote:
>> I kinda wish we had a template lambda.
>
> you mean alias compiles (__top A) = ((__top x) => 
> __traits(compiles, x)(A); ?

Not sure what __top is, but the compiles trait is special in that 
it can't be wrapped in a template (it's not really a trait of a 
symbol or expression like its type, but a deeper semantic 
analysis of an expression).

'Template lambda' is really anonymous templates:
enum(alias Sym) => __traits(isModule, Sym)


More information about the Digitalmars-d mailing list