Challenge

Manu via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 5 07:38:54 PDT 2016


On 5 October 2016 at 19:45, Jonathan M Davis via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Wednesday, October 05, 2016 09:24:56 John Colvin via Digitalmars-d wrote:
>> > It _is_ however recommended to use __traits(getMember, T,
>> > member) over manually building it with strings with something
>> > like T.stringof ~ "." ~ member, because the string manipulation
>> > falls about in corner cases (e.g. it could result in a symbol
>> > conflict). It's just that then has the unfortunate side effect
>> > of requiring AliasSeq because of the bug.
>> >
>> > - Jonathan M Davis
>>
>> https://dlang.org/phobos/std_meta.html#.Alias   :)
>
> IMHO, that doesn't improve things much, but it is slightly shorter. Thanks
> for pointing it out.

I thought there was a distinction between typetuple and alias? Some
expression can be captured by a typetuple, but not by alias?
There must be a reason for that horrible and prolific pattern "(T...)
if(T.length == 1) { ... T[0] ... }" instead of "(alias T) { ... T ...
}"?


More information about the Digitalmars-d mailing list