Re: struct vs built-in type

2014-12-17 Thread Jack Applegame via Digitalmars-d-learn
On Wednesday, 17 December 2014 at 08:09:44 UTC, Daniel Kozák via Digitalmars-d-learn wrote: This should work only with ref by spec I totally agree.

Re: struct vs built-in type

2014-12-17 Thread Rikki Cattermole via Digitalmars-d-learn
On 17/12/2014 8:57 p.m., Jack Applegame wrote: Code: import std.stdio; struct Bar { int payload; alias payload this; } struct Foo { private { Bar m_bar; int m_baz; } @property { Bar bar() { return m_bar; } void bar(Bar v) { m_bar = v;

Re: struct vs built-in type

2014-12-17 Thread Daniel Kozák via Digitalmars-d-learn
V Wed, 17 Dec 2014 07:57:24 + Jack Applegame via Digitalmars-d-learn napsáno: > Code: > > import std.stdio; > > struct Bar { > int payload; > alias payload this; > } > struct Foo { > private { > Bar m_bar; > int m_baz; > } > @propert

struct vs built-in type

2014-12-17 Thread Jack Applegame via Digitalmars-d-learn
Code: import std.stdio; struct Bar { int payload; alias payload this; } struct Foo { private { Bar m_bar; int m_baz; } @property { Bar bar() { return m_bar; } void bar(Bar v) { m_bar = v; }