Error instantiating std.container.Array

Francesco Cattoglio via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 2 06:40:50 PST 2015


On Monday, 2 March 2015 at 14:14:19 UTC, Tobias Pankrath wrote:
> Try to reduce your Material class for a small failing example. 
> It's probably your constructors or opAssign or something like 
> that. Anyway, it's a bug if template errors from the 
> implementation bubble up, so please file a report.
I'm still trying now, with no luck.
I also tried to get a Material[] instead of an Array!Material. It 
compiles, but when I call std.algorithm.sort on it I get another 
funny error, which apparently not even google can find except for 
one lonely test unit:

C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d(2222): Error: 
cannot have parameter of function type void()
C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d(2278): Error: 
cannot have parameter of function type void()
C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d(2306): Error: 
cannot have parameter of function type void()

Following a few more lines concerning who tried to instantiate it:
....\src\phobos\std\range.d(8385): Error: template instance 
std.range.stride!(Material[]) error instantiating
....\src\phobos\std\algorithm.d(9383): instantiated from here: 
SortedRange!(Material[], "a.step < b.step")
....\material.d(15): instantiated from here: sort!("a.step < 
b.step", cast (SwapStrategy)0, Material[])

(".step" is a class member variable, it's a simple int)
I'm really clueless... :P


More information about the Digitalmars-d-learn mailing list