auto ref add(V)(auto ref V v1, auto ref V v2);
// default this(this)
Vec3f vec1;
// accepts both lvalues and rvalues
auto res = add(vec1, Vec3f(1, 2, 3.14));
auto ref produces template bloat. That is no real solution for
the rvalue ref problem. But there is (more or less) a workaround:
On Saturday, 2 April 2016 at 09:28:58 UTC, ZombineDev wrote:
On Wednesday, 23 March 2016 at 19:39:49 UTC, kinke wrote:
On Tuesday, 22 March 2016 at 07:35:49 UTC, ZombineDev wrote:
If the object is larger than the size of a register on the
target machine, it is implicitly passed by ref
That's
On Wednesday, 23 March 2016 at 19:39:49 UTC, kinke wrote:
On Tuesday, 22 March 2016 at 07:35:49 UTC, ZombineDev wrote:
If the object is larger than the size of a register on the
target machine, it is implicitly passed by ref
That's incorrect. As Johan pointed out, this is somewhat true
for th
On Tuesday, 22 March 2016 at 07:35:49 UTC, ZombineDev wrote:
If the object is larger than the size of a register on the
target machine, it is implicitly passed by ref
That's incorrect. As Johan pointed out, this is somewhat true for
the Win64 ABI (but it firstly copies the argument before pass
On Tuesday, 22 March 2016 at 07:35:49 UTC, ZombineDev wrote:
If the object is larger than the size of a register on the
target machine, it is implicitly passed by ref (i.e. struct
fields are accessed by offset from the stack pointer).
(Oops, sorry ZombineDev, should've read your reply first)
On Monday, 21 March 2016 at 23:31:06 UTC, ref2401 wrote:
I have got a plenty of structs in my project. Their size varies
from 12 bytes to 128 bytes.
Is there a rule of thumb that states which structs I pass by
value and which I should pass by reference due to their size?
Note that the compiler
On Monday, 21 March 2016 at 23:31:06 UTC, ref2401 wrote:
I have got a plenty of structs in my project. Their size varies
from 12 bytes to 128 bytes.
Is there a rule of thumb that states which structs I pass by
value and which I should pass by reference due to their size?
Thanks.
If the objec
On Monday, 21 March 2016 at 23:31:06 UTC, ref2401 wrote:
I have got a plenty of structs in my project. Their size varies
from 12 bytes to 128 bytes.
Is there a rule of thumb that states which structs I pass by
value and which I should pass by reference due to their size?
Thanks.
Not really.
I have got a plenty of structs in my project. Their size varies
from 12 bytes to 128 bytes.
Is there a rule of thumb that states which structs I pass by
value and which I should pass by reference due to their size?
Thanks.