D's Auto Decoding and You
Steven Schveighoffer via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Tue May 17 10:26:59 PDT 2016
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.
There is an inconsistency in the compiler for this. If s.front is a
function is(typeof(s.front)) will not be what front *returns*, but the
function type itself. Unless you tag with @property. However, it's
perfectly legal for a front function not to be tagged @property.
-Steve
More information about the Digitalmars-d-announce
mailing list