Trying to make my program care about const qualifier I've ended up with the following problem:
-----------------
struct Foo
{
    int* a;

    inout this(inout int* src) pure
    {
        a = src;
    }

    inout void opAssign(inout Foo f) pure
    {
a = f.a; // Error: can only initialize const member a inside constructor
    }
}

struct Boo
{
    Foo foo;

    inout this(inout int* src) pure
    {
        foo = Foo(src);
    }
}
-----------------
This code would work even without opAssign but let's imagine we need it for some reason.
Is there any way to initialize `foo` without opAssign call?

Reply via email to