On Tuesday, 13 February 2018 at 12:12:30 UTC, Nathan S. wrote:
On Monday, 12 February 2018 at 02:05:16 UTC, aliak wrote:
struct B(T) {
    T t;
}

struct A(T) {
    T t;
    auto opCast(U)() {
        return B!U(cast(U)t);
    }
}

void main() {
    auto a = A!int(3);
    auto b = cast(float)a; // error
}

Having the result of "cast(float) a" not be a float would be evil.

Ya :p dunno what I was thinking.

Reply via email to