On Wednesday, 18 December 2013 at 22:26:32 UTC, Timon Gehr wrote:
The natural interpretation of a const constructor is that it constructs a const object directly. Such a constructor could eg. initialize a field declared with a mutable type using some external const reference.

void foo(const(int[]) a){
    // ...
    struct S{
        int[] a;
        this()const{
            this.a=a;
        }
    }
    // ...
}

The DIP argues that such a construct is not particularly useful and hence eliminates it for the purpose of using the syntax for a _different_ concept. There is no way to implement the above constructor using the new semantics.

Just my 2 cents: I have to agree. The const can be confusing and making it so that a different concept cannot be implemented really looks like a bad idea.

Reply via email to