Methods in enums

user1234 user1234 at 12.de
Fri Aug 18 16:30:00 UTC 2023


On Friday, 18 August 2023 at 12:11:04 UTC, sighoya wrote:
> On Friday, 18 August 2023 at 11:21:57 UTC, user1234 wrote:
>
>> ```
>> mixin(generateSelectiveImportForTypeAndUFCSCapableFunctionOf!("someModule", "someType")())
>> ```
>>
>> However one thing I have observed, in the past, is that even 
>> if you make the metaprog-equivalent code of a compiler-grade 
>> feature, people wont use it. So at some point the question is 
>> more: should this be builtin (e.g as a __traits) or be in 
>> std.typecons/std.traits ?
>>
>> Big question.
>
> Yes, but then you have again the problem of importing methods 
> separately to types.

Yes. The metaprog in the mixin hides the import, just like what 
will do a compiler.
"I can find this, but is this result correct given the scope ?".



More information about the Digitalmars-d mailing list