D's Auto Decoding and You

Steven Schveighoffer via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue May 17 11:39:01 PDT 2016


On 5/17/16 2:23 PM, Vladimir Panteleev wrote:
> On Tuesday, 17 May 2016 at 17:26:59 UTC, Steven Schveighoffer wrote:
>> On 5/17/16 1:18 PM, Vladimir Panteleev wrote:
>>> On Tuesday, 17 May 2016 at 14:06:37 UTC, Jack Stouffer wrote:
>>>> http://jackstouffer.com/blog/d_auto_decoding_and_you.html
>>>
>>> Thanks for writing this. Great article.
>>>
>>> Some remarks:
>>>
>>>>    static assert(is(typeof(s.front()) == dchar));
>>>
>>> I believe .front is a property (so some ranges can implement it as a
>>> field, not a @property function). Hence, no parens.
>>
>> Right, but s is a string. So front is a function.
>
> Then what happened to writing generic code?

This isn't generic code, it's just demonstrating that string's front 
does not yield immutable(char). It's very specific to string.

In my recommendation to add the parens, I wasn't sure if front is marked 
@property or not.

In any case, this is a lot of conversation about something that isn't 
that important :)

-Steve


More information about the Digitalmars-d-announce mailing list