struct S( Element )
{
Element[] data;
this( in uint len )
{
data.length = len;
}
ref Element opIndex( in uint n )
{
return data[n];
}
ref Element opIndexAssign( in Element a, in uint n )
{
data[n] += a;
return data[n];
}
On Fri, 12 Dec 2008 02:21:11 +0300, BCS a...@pathlink.com wrote:
Reply to Weed,
ref Element opIndex( in uint n )
{
return data[n];
}
ref Element opIndexAssign( in Element a, in uint n )
{
data[n] += a;
return data[n];
}
I'm guessing as I don't use 2.0 but I think that this is a bug. DMD
ref Element opIndexAssign( in Element a, in uint n )
{
data[n] += a;
return data[n];
}
I'm guessing as I don't use 2.0 but I think that this is a bug. DMD is
trying to say that the above returns are trying to return something
that can't be referenced (like a math expression result).
It is
Reply to Denis,
On Fri, 12 Dec 2008 02:21:11 +0300, BCS a...@pathlink.com wrote:
Reply to Weed,
invariant()
{
// If I comment out next line compilation goes smoothly:
assert( Element.sizeof 0 );
}
OTOH that assert is wrong. Element.sizeof will always return 8, the
size of an array
On Fri, 12 Dec 2008 02:47:42 +0300, BCS a...@pathlink.com wrote:
Reply to Denis,
On Fri, 12 Dec 2008 02:21:11 +0300, BCS a...@pathlink.com wrote:
Reply to Weed,
invariant()
{
// If I comment out next line compilation goes smoothly:
assert( Element.sizeof 0 );
}
OTOH that assert is