Error about @disabled constructor when there is a custom one
Minas Mina
minas_mina1990 at hotmail.co.uk
Tue Jan 22 10:45:28 PST 2013
I have this structure:
struct Scene
{
Array!Surface objects; // objects in the scene
Array!Light lights; // lights in the scene
/*private*/ BVHNode root; // root node of the BVH tree
@disable this(); // disable the default constructor because
space needs to be reserved for objects and lights
this(size_t objectReserveSpace = 20, size_t lightReserveSpace =
3)
{
objects.reserve(objectReserveSpace);
lights.reserve(lightReserveSpace);
}
}
auto scene = Scene(); // error about @disabled constructor
Yes, the default constructor is @disabled BUT I am not using that
one. I want to use the other one - the custom constructor. I
guess it signals an error because it has those defaults
parameters. But shouldn't the compiler choose that one?
More information about the Digitalmars-d
mailing list