On Sunday, 30 July 2017 at 16:12:41 UTC, piotrekg2 wrote:
What is the idiomatic D code equivalent to this c++ code?
There's no direct equivalent of all your code to D using only
druntime+phobos AFAIK.
class Block
{
[...]
};
Since you don't seem to be using reference type semantics or
What is the idiomatic D code equivalent to this c++ code?
class Block
{
public:
Block()
: data_(new char[4096])
{}
...
// NOTE: both members marked noexcept
Block(Block &) noexcept = default;
Block& operator=(Block &) noexcept = default;
...
private:
std::unique_ptr
On Wednesday, 23 March 2016 at 23:44:55 UTC, ag0aep6g wrote:
You got the order of arguments wrong here. Source goes first,
Oh, derp. Thanks. Right then... it works as expected.
On 24.03.2016 00:44, ag0aep6g wrote:
On 24.03.2016 00:26, cy wrote:
++items.length
move(items[$-1],item); // Error: struct Thing is not copyable because it
is annotated with @disable
You got the order of arguments wrong here. Source goes first, target
second. Works for me with `move(item,
On 24.03.2016 00:26, cy wrote:
++items.length
move(items[$-1],item); // Error: struct Thing is not copyable because it
is annotated with @disable
You got the order of arguments wrong here. Source goes first, target
second. Works for me with `move(item, items[$-1]);`.
struct Thing {
@disable this(this);
}
...
items ~= move(item); // Error: struct Thing is not copyable
because it is annotated with @disable
++items.length
move(items[$-1],item); // Error: struct Thing is not copyable
because it is annotated with @disable
appender(items).put(move(item));
Another question on move semantics from the cheap seats...
See my code here: http://dpaste.dzfl.pl/995c5af59dd6
There are indeed three questions, all marked in the code, so the
rest of the text here is maybe redundant... but just in case and
for summary:
I try to model a inner class of some
Thank you very much for the comments.
It is much clearer now. The .outer link is just a shortcut, which
does not mean I don't have to reset it, where I have to.
So... essentially, my expectation WAS to subjective and I have to
separate better, what is the part of the model in my head and
what
On Tuesday 29 September 2015 16:38, Alex wrote:
> Another question on move semantics from the cheap seats...
>
> See my code here: http://dpaste.dzfl.pl/995c5af59dd6
[...]
> The first (minor) question is:
> I have to initialize some dummy inner objects, before I can apply
&g
On 09/29/2015 07:38 AM, Alex wrote:
> See my code here: http://dpaste.dzfl.pl/995c5af59dd6
> Following my code, the inner object I moved does not disappear from the
> array in the source outer object. Why?
> After I moved the inner object to the new outer object, the pointer to
> the outer
10 matches
Mail list logo