Type Qualifiers and Wild Cards

Walter Bright newshound2 at digitalmars.com
Tue Nov 8 16:05:14 PST 2011


On 11/8/2011 3:57 PM, Martin Nowak wrote:
> Yeah, the two common C++ solutions are either overload macros or non-transitive
> const.
> Remarkably enough it's hardly understood in a C++ context that transitive
> qualifiers offer much stronger guarantees.
> Take shared_ptr as a prominent example for the disaster.
>
> _Tp*
> get() const // never throws
> { return _M_ptr; }
>
> With the even worse C++ solution to this being const_iterator.

Many top shelf C++ programmers do understand these issues. They've complained to 
me about the unattractiveness of the various C++ solutions to the inout problem.

D's solution seems obvious only in retrospect.


More information about the Digitalmars-d mailing list