I give up! I tried to create a reflection library but D's traits are just too screwed up!
Atila Neves
atila.neves at gmail.com
Wed Apr 3 11:10:35 UTC 2019
On Wednesday, 3 April 2019 at 09:35:35 UTC, Alex wrote:
> On Wednesday, 3 April 2019 at 09:24:23 UTC, Atila Neves wrote:
>> On Wednesday, 3 April 2019 at 07:22:10 UTC, Alex wrote:
>>
>>> [...]
>>
>> void foo(T...)() if(T.length == 1) { /* ... */ }
>
> Doesn't work well, I have used that. Doesn't always work.
Do you have an example where it doesn't work?
>>> [...]
>>
>> import std.traits: moduleName;
>> mixin(`import `, moduleName!thingie, `;`);
>
> Um, that is not safe.
How so?
>>> [...]
>>
>> Use T.init when that's the case.
>
> Doesn't always work. I have done it.
Do you have an example?
> it should take you no time to fix up the code above.
Hire me and I'd be glad to.
More information about the Digitalmars-d
mailing list