Re: D move semantics

2017-07-30 Thread Moritz Maxeiner via Digitalmars-d-learn
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

D move semantics

2017-07-30 Thread piotrekg2 via Digitalmars-d-learn
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