On Sat, 25 May 2013 23:58:39 -0400, Peter Williams <pwil3...@bigpond.net.au> wrote:

Is the inability to use dup and ~ with const arrays of class objects a deliberate design restriction? I couldn't find mention of it in the specification or Andrei's book and only discovered it the hard way.

It has to be.  There is no cdup.

For any const(T)[] x, the type of x.dup is T[]. Because this would mean that you would remove const, you cannot do that. Nor can you idup, since implicit conversion to immutable is not possible.

As far as I know, ~ works with const arrays of class objects. Can you give a case where it fails?

-Steve

Reply via email to