rvalue types
Simen Kjærås
simen.kjaras at gmail.com
Mon Mar 12 18:46:56 UTC 2018
On Monday, 12 March 2018 at 16:51:06 UTC, H. S. Teoh wrote:
> I suspect the current language already supports this, or is 90%
> of the way there and just needs some small concessions on
> syntax. For example, today you can already make opBinary()
> return something other than the parent type, and use alias this
> to make it decay to the parent type. Of course, this requires
> the caller to write `BigInt x = a^^b % c` rather than `auto x =
> a^^b % c`, but I think that's a minor inconvenience.
I mostly agree, but it can play havoc on generic code. On the
other hand, if we don't think carefully through how they should
work, so would rvalue types.
--
Simen
More information about the Digitalmars-d
mailing list