On Monday, 12 February 2018 at 02:05:16 UTC, aliak wrote:
From spec: Cast expression: "cast ( Type ) UnaryExpression"
converts UnaryExpresssion to Type.
And https://dlang.org/spec/operatoroverloading.html#cast makes
no mention of the return type of opCast. One could think that
the return type of opCast would be the return type. But it
seems it must be the same as the template parameter of opCast
else you get a compile error that seems like it can be much
better.
- Ali
In my opinion, you should fill a documentation enhancement
request on issues.dlang.org.