|
|
|
|
@ -5575,7 +5575,7 @@ An initialization explicitly states that initialization, rather than assignment,
|
|
|
|
|
class A { // Good
|
|
|
|
|
string s1;
|
|
|
|
|
public:
|
|
|
|
|
A(czstring p) : s1{p} { } // GOOD: directly construct (and the C-sting is explicitly named)
|
|
|
|
|
A(czstring p) : s1{p} { } // GOOD: directly construct (and the C-string is explicitly named)
|
|
|
|
|
// ...
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -6819,7 +6819,7 @@ Do *not* represent non-hierarchical domain concepts as class hierarchies.
|
|
|
|
|
|
|
|
|
|
Here most overriding classes cannot implement most of the functions required in the interface well.
|
|
|
|
|
Thus the base class becomes an implementation burden.
|
|
|
|
|
Furthermore, the user of `Container` cannot rely on the member functions actually performing a meaningful operations reasonably efficiently;
|
|
|
|
|
Furthermore, the user of `Container` cannot rely on the member functions actually performing meaningful operations reasonably efficiently;
|
|
|
|
|
it may throw an exception instead.
|
|
|
|
|
Thus users have to resort to run-time checking and/or
|
|
|
|
|
not using this (over)general interface in favor of a particular interface found by a run-time type inquiry (e.g., a `dynamic_cast`).
|
|
|
|
|
|