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

GC

2017-07-30 Thread piotrekg2 via Digitalmars-d-learn
I would like to learn more about GC in D. For example can anyone explain why do we need memset(0) here: https://github.com/dlang/phobos/blob/master/std/container/array.d#L356 , doesn't it assume a certain type of GC? What if there is a need to change the GC algorithm in the future? It would be

Re: Question on SSE intrinsics

2017-07-29 Thread piotrekg2 via Digitalmars-d-learn
On Saturday, 29 July 2017 at 18:19:47 UTC, Johan Engelen wrote: On Saturday, 29 July 2017 at 16:01:07 UTC, piotrekg2 wrote: Hi, I'm trying to port some of my c++ code which uses sse2 instructions into D. The code calls the following intrinsics: - _mm256_loadu_si256 - _mm256_movemask_epi8 Do

Question on SSE intrinsics

2017-07-29 Thread piotrekg2 via Digitalmars-d-learn
Hi, I'm trying to port some of my c++ code which uses sse2 instructions into D. The code calls the following intrinsics: - _mm256_loadu_si256 - _mm256_movemask_epi8 Do they have any equivalent intrinsics in D? I'm compiling my c++ code using gcc. Thanks, Piotr