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 synchronization primitives
without an issue. On the opposite side, D has a stricter
(transitive) const and it's almost useless in many cases. Is
there an article that explains best practices of using const in
D? The statement "In C++ const isn't transitive so we fixed
that." alone isn't convincing. The only way I see right now is
omitting the const keyword completely which is ridiculous.
- Best practices of using const envoid via Digitalmars-d-learn
- Re: Best practices of using con... Kagamin via Digitalmars-d-learn
- Re: Best practices of using con... XavierAP via Digitalmars-d-learn
- Re: Best practices of using con... Alex via Digitalmars-d-learn
- Re: Best practices of using con... H. S. Teoh via Digitalmars-d-learn
- Re: Best practices of using con... psycha0s via Digitalmars-d-learn
- Re: Best practices of using con... envoid via Digitalmars-d-learn
- Re: Best practices of using con... Marco de Wild via Digitalmars-d-learn
- Re: Best practices of using... Yatheendra via Digitalmars-d-learn
- Re: Best practices of u... H. S. Teoh via Digitalmars-d-learn
- Re: Best practices of u... Yatheendra via Digitalmars-d-learn