Suppose I have a struct type Foo
. I'm trying to create an std.container.Array
of const pointers to Foo
. I tried the obvious first:
import std.container;
alias FooArray = Array!(const(Foo*));
However, this causes a compiler error. Then I tried it with fewer parentheses:
alias FooArray = Array!(const Foo*);
But this gave the same error (error instantiating
apparently). What am I doing wrong here?
Array
probably needs to modify the reference (if not the object).
Try this:
alias FooArray = Array!(const(Foo)*);