On Sunday, 14 January 2018 at 00:55:27 UTC, Jonathan M Davis
wrote:
[...]
It the simplest case, it means that the compiler does a bitwise
copy rather than a deep copy, but in other cases, it means that
the compiler is able to use the object in-place rather than
creating a deep copy that it
On Friday, January 12, 2018 01:59:49 Tony via Digitalmars-d-learn wrote:
> On Monday, 8 January 2018 at 23:31:27 UTC, Jonathan M Davis wrote:
> > auto foo(T)(auto ref T t)
> > {
> >
> > return t;
> >
> > }
> >
> > foo(42);
> >
> > will result in foo being instantiated as
> >
> > int foo(int t)
On Monday, 8 January 2018 at 23:31:27 UTC, Jonathan M Davis wrote:
auto foo(T)(auto ref T t)
{
return t;
}
foo(42);
will result in foo being instantiated as
int foo(int t)
{
return t;
}
whereas
int i;
foo(i);
will result in foo being instantiated as
int foo(ref int t)
{
retur
would recommend to ignore auto ref for rvalue references. It
generates 2^N functions where N is the amount of auto ref parameters.
That the most awful template bloat I've ever seen.
It only generates 2^N functions if you call it 2^N different ways.
Most of the time you call it the same way.
rvalue references. It
generates 2^N functions where N is the amount of auto ref
parameters. That the most awful template bloat I've ever seen.
It only generates 2^N functions if you call it 2^N different
ways. Most of the time you call it the same way.
-Steve
If that would be tr
On 1/10/18 3:08 AM, Dgame wrote:
On Wednesday, 10 January 2018 at 01:56:02 UTC, Steven Schveighoffer wrote:
But current auto ref is what we have, so I would recommend using it.
I would recommend to ignore auto ref for rvalue references. It generates
2^N functions where N is the amount of
On Wednesday, 10 January 2018 at 01:56:02 UTC, Steven
Schveighoffer wrote:
But current auto ref is what we have, so I would recommend
using it.
I would recommend to ignore auto ref for rvalue references. It
generates 2^N functions where N is the amount of auto ref
parameters. That the most
On 1/8/18 6:07 PM, Jiyan wrote:
Sry i know i asked it already in IRC:
Are rvalue references already solved with auto ref?
https://p0nce.github.io/d-idioms/#Rvalue-references:-Understanding-auto-ref-and-then-not-using-it
Says rvalues are moved!
But an rvalue move is cheaper. You construct
On Monday, January 08, 2018 23:07:52 Jiyan via Digitalmars-d-learn wrote:
> Sry i know i asked it already in IRC:
> Are rvalue references already solved with auto ref?
>
> https://p0nce.github.io/d-idioms/#Rvalue-references:-Understanding-auto-re
> f-and-then-not-using-it
>
Sry i know i asked it already in IRC:
Are rvalue references already solved with auto ref?
https://p0nce.github.io/d-idioms/#Rvalue-references:-Understanding-auto-ref-and-then-not-using-it
Says rvalues are moved!
The other solution seems not so practical.
Is any solution to them intended, or
On Monday, 15 April 2013 at 23:16:57 UTC, Timothee Cour wrote:
What would be the difference between C++11's rvalue reference
&& (see
for example
http://thbecker.net/articles/rvalue_references/section_03.html)
and D's proposed rvalue references (eg
http://wiki.dlang.org/DIP36)
What would be the difference between C++11's rvalue reference && (see
for example http://thbecker.net/articles/rvalue_references/section_03.html)
and D's proposed rvalue references (eg http://wiki.dlang.org/DIP36) ?
So far I only saw C++'s const & mentioned, but C+
Am 02.01.2012 22:13, schrieb Simen Kjærås:
On Mon, 02 Jan 2012 15:02:30 +0100, Joshua Reusch
wrote:
Is it possible to create a template turning any value into a lvalue?
This would be helpful if a function expects a reference but you dont
need the result of the change:
///decode(S)(in S str, r
On Mon, 02 Jan 2012 15:02:30 +0100, Joshua Reusch
wrote:
Is it possible to create a template turning any value into a lvalue?
This would be helpful if a function expects a reference but you dont
need the result of the change:
///decode(S)(in S str, ref size_t index);
auto c = std.utf.deco
On Mon, 02 Jan 2012 15:02:30 +0100, Joshua Reusch
wrote:
Is it possible to create a template turning any value into a lvalue?
This would be helpful if a function expects a reference but you dont
need the result of the change:
///decode(S)(in S str, ref size_t index);
auto c = std.utf.deco
On 01/02/2012 03:02 PM, Joshua Reusch wrote:
Is it possible to create a template turning any value into a lvalue?
This would be helpful if a function expects a reference but you dont
need the result of the change:
///decode(S)(in S str, ref size_t index);
auto c = std.utf.decode(some_string, lva
Is it possible to create a template turning any value into a lvalue?
This would be helpful if a function expects a reference but you dont
need the result of the change:
///decode(S)(in S str, ref size_t index);
auto c = std.utf.decode(some_string, lval!0);
17 matches
Mail list logo