On Wednesday, 13 February 2019 at 22:29:18 UTC, solidstate1991
wrote:
When I tried to apply to a position at Symmetry, I've got a
criticism from Atila Neves that some of my code relied too much
on memcpy, thus making it unsafe. After digging into std.array,
I found some function that could poss
When I tried to apply to a position at Symmetry, I've got a
criticism from Atila Neves that some of my code relied too much
on memcpy, thus making it unsafe. After digging into std.array, I
found some function that could possibly replace it to emulate
writing in the middle of a file, but at lea
On Wednesday, 13 February 2019 at 11:32:46 UTC, envoid wrote:
Is there an article that explains best practices of using const
in D?
You can find some information here:
https://dlang.org/articles/const-faq.html
On Wed, Feb 13, 2019 at 11:32:46AM +, envoid via Digitalmars-d-learn wrote:
> In C++ we have const correctness in some way. A compiler can make
> optimizations whenever it doesn't find a const_cast and the mutable
> specifier marks members that aren't a part of the object state. Of
> course, it
On Wednesday, 13 February 2019 at 11:32:46 UTC, envoid wrote:
Is there an article that explains best practices of using const
in D?
Chapter 8 of Andrei Alexandrescu's book The D Programming
Language.
On Wednesday, 13 February 2019 at 11:32:46 UTC, envoid wrote:
Is there an article that explains best practices of using const
in D?
http://jmdavisprog.com/articles/why-const-sucks.html
D has immutable data, const allows to consume both mutable and
immutable data.
In C++ we have const correctness in some way. A compiler can make
optimizations whenever it doesn't find a const_cast and the
mutable specifier marks members that aren't a part of the object
state. Of course, it's not perfect but one can document their
intentions and it's possible to use synchr