mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fix spacing in ES.63 example (#1351)
This commit is contained in:
parent
d6a6e7092a
commit
a10668dc1d
|
@ -12110,7 +12110,7 @@ In the rare cases where the slicing was deliberate the code can be surprising.
|
|||
Circle c2 {{1, 1}, 43};
|
||||
assign(c, c2); // oops, not the whole state is transferred
|
||||
assert(c == c2); // if we supply copying, we should also provide comparison,
|
||||
// but this will likely return false
|
||||
// but this will likely return false
|
||||
|
||||
The result will be meaningless because the center and radius will not be copied from `c` into `s`.
|
||||
The first defense against this is to [define the base class `Shape` not to allow this](#Rc-copy-virtual).
|
||||
|
|
Loading…
Reference in New Issue
Block a user