3

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?

Koz Ross
  • 3,040
  • 2
  • 24
  • 44

1 Answers1

3

Array probably needs to modify the reference (if not the object).

Try this:

alias FooArray = Array!(const(Foo)*);
Vladimir Panteleev
  • 24,651
  • 6
  • 70
  • 114