On 09/09/2010 06:26 PM, Steven Schveighoffer wrote:
Yes, I forgot that you are allowed to overload via ref. That would make
sense for virtual functions.
That forces us to provide multiple overloads, each matching one of the
possible combinations of rvalue/lvalue arguments. A function with n
A while back dmd stopped allowing rvalues as ref function arguments. I
entirely understand why it was done, but the same restriction applies to the
ref const function parameters. This causes a lot of pain and at the moment
makes me use pass-by-value parameters(most notably when using structs). C++
Eldar Insafutdinov:
Can we please restore this behavior for const ref?
From what I have seen D is built on different principles, so I doubt that will
change.
Bye,
bearophile
On Thu, 09 Sep 2010 06:08:14 -0400, Eldar Insafutdinov
e.insafutdi...@gmail.com wrote:
A while back dmd stopped allowing rvalues as ref function arguments. I
entirely understand why it was done, but the same restriction applies to
the
ref const function parameters. This causes a lot of pain
== Quote from Eldar Insafutdinov (e.insafutdi...@gmail.com)'s article
A while back dmd stopped allowing rvalues as ref function arguments. I
entirely understand why it was done, but the same restriction applies to the
ref const function parameters. This causes a lot of pain and at the moment
== Quote from dsimcha (dsim...@yahoo.com)'s article
FWIW, if you can't use templates and auto ref, there is a (slightly verbose)
solution. DMD apparently allows overloading ref vs. non-ref, so you can
write a
forwarding function to bind to rvalues.
...except that I just realized it's broken
I agree that auto ref may be a better option here, but I still see no reason to
disallow it. It is a performance issue, not a safety one. And as you said this
only works for templates, virtual functions are out of the game here.
PS. opEquals issue is very annoying, indeed.
On Thu, 09 Sep 2010 11:24:14 -0400, Eldar Insafutdinov
e.insafutdi...@gmail.com wrote:
I agree that auto ref may be a better option here, but I still see no
reason to
disallow it. It is a performance issue, not a safety one. And as you
said this
only works for templates, virtual functions
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
On Thu, 09 Sep 2010 11:24:14 -0400, Eldar Insafutdinov
e.insafutdi...@gmail.com wrote:
I agree that auto ref may be a better option here, but I still see no
reason to
disallow it. It is a performance issue, not a safety
On 9/9/10 6:32 CDT, Steven Schveighoffer wrote:
On Thu, 09 Sep 2010 06:08:14 -0400, Eldar Insafutdinov
e.insafutdi...@gmail.com wrote:
A while back dmd stopped allowing rvalues as ref function arguments. I
entirely understand why it was done, but the same restriction applies
to the
ref const
On 9/9/10 10:43 CDT, dsimcha wrote:
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
On Thu, 09 Sep 2010 11:24:14 -0400, Eldar Insafutdinov
e.insafutdi...@gmail.com wrote:
I agree that auto ref may be a better option here, but I still see no
reason to
disallow it. It is a
On Thu, 09 Sep 2010 13:03:17 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 9/9/10 6:32 CDT, Steven Schveighoffer wrote:
On Thu, 09 Sep 2010 06:08:14 -0400, Eldar Insafutdinov
e.insafutdi...@gmail.com wrote:
A while back dmd stopped allowing rvalues as ref function
12 matches
Mail list logo