On Monday, 23 July 2018 at 19:31:42 UTC, aliak wrote:
Ok, now I'm totally confused. Defining an extra type constructor makes everything work. I.e add a const one to the inout one:

auto defined(T)(const auto ref T value) {
    return W!T(value);
}

and everything works!

Can anyone say why that is?

Boh, seems other problems crop up now as doing this:

auto a = defined!(int*)(null);

produces error:

onlineapp.d(13): Error: inout constructor onlineapp.W!(int*).W.__ctor!(int*).this creates const object, not mutable onlineapp.d(30): Error: template instance `onlineapp.defined!(int*)` error instantiating

https://run.dlang.io/is/BWYxA8

Reply via email to