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

Max Samukha maxsamukha at gmail.com
Thu Oct 8 10:11:59 UTC 2020


On Thursday, 8 October 2020 at 09:42:22 UTC, Jacob Carlborg wrote:
> On Wednesday, 7 October 2020 at 19:44:59 UTC, H. S. Teoh wrote:
>
>
> Yes, because just wrapping existing `__traits` in templates 
> don't give you much value, just a different syntax.

Wrapping __traits in templates is a necessity if you want to use 
them for anything interesting (such as passing them to higher 
order functions):

filter!(__traits(isPOD), A, B C); // no way
filter!(isPod, A, B, C); // can be



More information about the Digitalmars-d mailing list