Properties don't work as expected
H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Jul 5 09:14:53 PDT 2016
On Tue, Jul 05, 2016 at 04:11:58PM +0000, zabruk70 via Digitalmars-d-learn wrote:
> On Tuesday, 5 July 2016 at 10:52:10 UTC, zodd wrote:
> > Property functions are used wrong by a compiler when it needs
>
> i am sorry for my dumbness, what wrong with this code?
>
> import std.stdio;
>
> struct A {
> @property ref int value() {
> return value_;
> }
>
> @property void value(int v) {
> value_ = v;
> }
This overload is redundant, now that the first overload is ref.
> private:
> int value_;
> }
[...]
T
--
He who does not appreciate the beauty of language is not worthy to bemoan its flaws.
More information about the Digitalmars-d-learn
mailing list