Re: Overloading for lvalue and rvalue.

2017-06-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, June 12, 2017 20:40:52 Balagopal Komarath via Digitalmars-d-learn wrote: > Is there a way to avoid the following combinatorial explosion of > overloaded functions when overloading for lvalue and rvalue > arguments? The following may be a bad example because int is > cheap

Overloading for lvalue and rvalue.

2017-06-12 Thread Balagopal Komarath via Digitalmars-d-learn
Is there a way to avoid the following combinatorial explosion of overloaded functions when overloading for lvalue and rvalue arguments? The following may be a bad example because int is cheap to copy. So assume a large datatype instead of int. import std.stdio; void foo(in ref int a, in ref