On Wednesday, 14 July 2021 at 08:24:03 UTC, Tejas wrote:
>Last question:
How do you exactly specify that you're expecting a rvalue reference as a parameter?
In other words, what is the D equivalent of this C++ code:
func(T&& parameter) { }
There isn't. in
is for const references. -preview=rvaluerefparam
will allow you to get a mutable ref, but it simply creates a temporary at the call site (so does -preview=in
). To my knowledge, we can't represent that in D (and we can't bind to such a definition in C++).