Really in need of help with std.container.array.d

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Oct 14 05:41:21 PDT 2014


On Monday, 13 October 2014 at 13:46:56 UTC, Robert burner Schadek 
wrote:
> other than that I'm not sure how to go about this.

I tried replace inout with a C++-style member duplication at

https://github.com/nordlow/phobos/commit/b2a4ca28bf25bf7c6149566d066cbb54118b36b4

Now it instead errors as

Error: mutable method 
std.container.array.Array!int.Array.__fieldPostBlit is not 
callable using a const object
array.d(252,26): Error: 
cast(inout(int))this._outer.opIndex(this._a) is not an lvalue
array.d(258,26): Error: 
cast(inout(int))this._outer.opIndex(this._b - 1LU) is not an 
lvalue
../../std/algorithm.d(2364,9): Error: cannot modify const 
expression result
array.d(276,24): Error: template instance 
std.algorithm.move!(const(int)) error instantiating
array.d(439,5):        instantiated from here: 
Range!(const(Array!int))
array.d(851,5):        instantiated from here: Array!int
array.d(294,26): Error: 
cast(inout(int))this._outer.opIndex(this._a + i) is not an lvalue
Error: mutable method std.container.array.Array!int.Array.~this 
is not callable using a const object
array.d(320,30): Error: None of the overloads of 'opSliceAssign' 
are callable using a const object, candidates are:
array.d(507,10):        
std.container.array.Array!int.Array.opSliceAssign(int value)
array.d(514,10):        
std.container.array.Array!int.Array.opSliceAssign(int value, 
ulong i, ulong j)
array.d(326,38): Error: None of the overloads of 'opSliceAssign' 
are callable using a const object, candidates are:
array.d(507,10):        
std.container.array.Array!int.Array.opSliceAssign(int value)
array.d(514,10):        
std.container.array.Array!int.Array.opSliceAssign(int value, 
ulong i, ulong j)
array.d(299,32): Error: mutable method 
std.container.array.Array!int.Array.Range!(Array!int).Range.this 
is not callable using a const object
array.d(309,32): Error: mutable method 
std.container.array.Array!int.Array.Range!(Array!int).Range.this 
is not callable using a const object
array.d(443,5): Error: template instance 
std.container.array.Array!int.Array.Range!(Array!int) error 
instantiating
array.d(851,5):        instantiated from here: Array!int
../../std/typecons.d(3889,17): Error: template instance 
object.destroy!(Payload) error instantiating
array.d(169,26):        instantiated from here: 
RefCounted!(Payload, cast(RefCountedAutoInitialize)0)
array.d(851,5):        instantiated from here: Array!int
array.d(880,5): Error: static assert  (!true) is false

Ideas?


More information about the Digitalmars-d-learn mailing list