const references in C++ and D

Kagamin spam at here.lot
Thu Jun 3 06:09:39 PDT 2010

Steven Schveighoffer Wrote:

> However, it surprisingly is less optimal for rvalues to pass by ref.

So what? It just must work. Efficiency of a particular operation doesn't mean efficiency of a program: it can use lvalues most of time.

> D's solution is to use auto ref, but I think your attempts to use it show  
> that it doesn't work.  You should file a bug with your program 3.

auto ref works only for return values, implementing it for parameters means combinatorial bloat.

More information about the Digitalmars-d-learn mailing list