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

Stefan Koch uplink.coder at googlemail.com
Thu Oct 8 11:47:48 UTC 2020


On Thursday, 8 October 2020 at 10:11:59 UTC, Max Samukha wrote:
> 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

or you use type functions which can use them at ctfe;)


More information about the Digitalmars-d mailing list