Imcompatible type, const and const
bearophile
bearophileHUGS at lycos.com
Sun Mar 9 10:58:06 PDT 2014
Duarte:
> Hmm
> Vector2 vec = cast(Point2)this - cast(Point2)_right
> does the trick. But I can't help to feel this is a ugly
> hack/workaround to a problem elsewhere...
In your code you don't have this problem, but in D, unlike C++,
mutating const/immutable data is undefined, and leading to
unpredictable but frequent bugs.
Bye,
bearophile
More information about the Digitalmars-d-ide
mailing list