6 ms·
Is diamond inheritance really part of that fabric? Diamond inheritance isn't a problem in C++ as each inheritance path is followed separately. A small price to
by shin_lao 10y ago
Is diamond inheritance really part of that fabric?
Diamond inheritance isn't a problem in C++ as each inheritance path is followed separately. A small price to pay to enjoy the power of multiple inheritance.
And NULL?
NULL is deprecated since C++ 11 in favor of nullptr.
C++ is old and has only accumulated, never lost.
You may want to have a look at the latest standards.
- cynicalkane 10y agoI don't think the usual criticisms of NULL are satisfied by it becoming slightly more type-safe.
- izym 10y agoReferences don't allow null.
- paulddraper 10y agoAgreed. https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/ https://www.lucidchart.com/techblog/2015/08/31/the-worst-mis...
- humanrebar 10y ago> NULL is deprecated since C++ 11 in favor of nullptr Pedantically, it's discouraged, not deprecated. NULL is a preprocessor constant defined in so many places, often in contradictory ways. There's no practical way for the C++ standards to deprecate it. Compiler and analysis tools vendors could (and should) provide warnings when NULL is used when nullptr is more appropriate (which is always IMO).
- pjmlp 10y agoActually before nullptr was designed, the good practice in C++ was to use a plain 0, due to the way NULL is sometimes defined and how implicit conversions work. Seeing C++ codebases using 0 for pointers instead of NULL was already a sign how up to date the respective programmers were with C++'s best practices.