rvalue references

bitwise via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 11 16:56:19 PDT 2015


On Wed, 10 Jun 2015 04:52:46 -0400, kink <noone at nowhere.com> wrote:

> I know what `in` currently means. Your proposed `in ref T` syntax is imo  
> not much better than C++ `const T&`, so I'd prefer a simple and  
> convenient `in T`. Semantics would be identical to your `in ref` with  
> the additional optimization for small POD types. And for beginners, one  
> could simply describe it as:
> 'Use the in keyword for a parameter if you're not going to mutate it.  
> Don't rely on its identity as the argument may be passed by value or  
> reference, whatever seems more efficient for the compiler and the target  
> platform.'

+1

   Bit


More information about the Digitalmars-d mailing list