mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-18 21:24:41 +03:00
again
This commit is contained in:
@@ -9787,7 +9787,7 @@ In the rare cases where the slicing was deliberate the code can be surprising.
|
|||||||
class Shape { /* ... */ };
|
class Shape { /* ... */ };
|
||||||
class Circle : public Shape { /* ... */ Point c; int r; };
|
class Circle : public Shape { /* ... */ Point c; int r; };
|
||||||
|
|
||||||
Circle c {{%raw%}.{{%endraw%}.0,0}, 42};
|
Circle c {{%raw%}}{{{{%endraw%}}.0,0}, 42};
|
||||||
Shape s {c}; // copy Shape part of Circle
|
Shape s {c}; // copy Shape part of Circle
|
||||||
|
|
||||||
The result will be meaningless because the center and radius will not be copied from `c` into `s`.
|
The result will be meaningless because the center and radius will not be copied from `c` into `s`.
|
||||||
|
|||||||
Reference in New Issue
Block a user