On Saturday, 22 January 2022 at 19:01:09 UTC, Stanislav Blinov
wrote:
On Saturday, 22 January 2022 at 18:00:58 UTC, vit wrote:
[...]
Take by value and make a copy without forwarding:
```d
import std.typecons : Tuple;
import std.meta : allSatisfy;
[...]
Thanks, second options is what I
On Saturday, 22 January 2022 at 18:00:58 UTC, vit wrote:
I want implement something like this:
Scratch the previous reply, 'twas a brain fart... Simply take by
value, no need for extra copies at all in that case. Arguments
themselves will become those copies as needed.
```d
import
On Saturday, 22 January 2022 at 18:00:58 UTC, vit wrote:
I want implement something like this:
...
Take by value and make a copy without forwarding:
```d
import std.typecons : Tuple;
import std.meta : allSatisfy;
enum bool isRcPtr(T) = is(T == RcPtr!U, U);
//@safe access to data of
On Saturday, 22 January 2022 at 17:23:12 UTC, Ali Çehreli wrote:
On 1/22/22 07:17, vit wrote:
> Why local variable of type tuple call destructors immediately
after
> initialization?
I don't even understand where the local variable comes from. If
you want a pair of Foo objects, I would use
On 1/22/22 07:17, vit wrote:
> Why local variable of type tuple call destructors immediately after
> initialization?
I don't even understand where the local variable comes from. If you want
a pair of Foo objects, I would use std.typeconst.Tuple.
Otherwise I would use AliasSeq as I understand
On Saturday, 22 January 2022 at 14:23:32 UTC, Adam Ruppe wrote:
You can't forward to a local variable. Local variables will be
a copy of the tuple. forward only actually works if sent
*directly* to another function call.
There's a bunch of things in D that only work in function
parameter
You can't forward to a local variable. Local variables will be a
copy of the tuple. forward only actually works if sent *directly*
to another function call.
There's a bunch of things in D that only work in function
parameter lists and not local variables. This is one of them.