What ever happened to move semantics?
Walter Bright
newshound2 at digitalmars.com
Tue Feb 27 23:16:50 UTC 2024
On 2/27/2024 4:45 AM, Manu wrote:
> I'd like to see the DIP address this idiom (which Scott Meyers termed a
> 'universal reference'), which is ESSENTIAL in extern(C++) and must be covered or
> practically no C++ code can ever be represented:
> template<T> void fun(T&& universalRef);
> In this case; the template will be instantiated as `Ty&&` or `const Ty&`
> depending on the rvalue-ness of the argument supplied at the call site.
>
> I think `auto ref` needs to be covered by the DIP, and probably considered with
> respect to this point.
Yeah, you're right.
More information about the Digitalmars-d
mailing list