On Wednesday, June 20, 2012 09:03:44 cal wrote:
> On Wednesday, 20 June 2012 at 06:34:06 UTC, Jonathan M Davis
>
> wrote:
> > You can't overload on return type. The parameters need to be
> > different, or the functions are going to conflict.
>
> Ah, that explains it, thanks. I find ref properties
On Wednesday, 20 June 2012 at 06:34:06 UTC, Jonathan M Davis
wrote:
You can't overload on return type. The parameters need to be
different, or the functions are going to conflict.
Ah, that explains it, thanks. I find ref properties useful for
making a member variable behave like it is public,
On Wednesday, June 20, 2012 05:42:25 cal wrote:
> This doesn't compile, because the assignment matches both
> property functions in S:
>
> struct S
> {
> @property int a() { return _a; }
> @property ref int a() { return _a; }
> int _a;
> }
>
> int main()
> {
> S s;
> s.a
This doesn't compile, because the assignment matches both
property functions in S:
struct S
{
@property int a() { return _a; }
@property ref int a() { return _a; }
int _a;
}
int main()
{
S s;
s.a = 5;
}
But I would like to be able to do different things when I pass
out a r