What is the current stage of @property ?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Jun 10 23:01:35 UTC 2020


On Wed, Jun 10, 2020 at 10:50:17PM +0000, Paul Backus via Digitalmars-d-learn wrote:
> On Wednesday, 10 June 2020 at 21:41:54 UTC, H. S. Teoh wrote:
> > There are a few places where it's needed (like satisfying the range
> > API, which implicitly checks for it)
> 
> That may have been true at one point, but it isn't true now:
> 
> struct S {
>     bool empty() { return false; }
>     int front() { return 0; }
>     void popFront() {}
> }
> 
> static assert(isInputRange!S); // passes

Nice.  So pretty soon I can get rid of @property spam from my code,
which is really not very useful and only adds extra keystrokes for
little benefit.


T

-- 
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan


More information about the Digitalmars-d-learn mailing list