mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +03:00
Merge pull request #1095 from brenoguim/hotfix/public-deleted-methods
Add public access modifier to examples
This commit is contained in:
@@ -5968,6 +5968,7 @@ To prevent slicing, because the normal copy operations will copy only the base p
|
|||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
class B { // GOOD: base class suppresses copying
|
class B { // GOOD: base class suppresses copying
|
||||||
|
public:
|
||||||
B(const B&) = delete;
|
B(const B&) = delete;
|
||||||
B& operator=(const B&) = delete;
|
B& operator=(const B&) = delete;
|
||||||
virtual unique_ptr<B> clone() { return /* B object */; }
|
virtual unique_ptr<B> clone() { return /* B object */; }
|
||||||
@@ -17868,6 +17869,7 @@ If you intend for a class to match a concept, verifying that early saves users p
|
|||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
class X {
|
class X {
|
||||||
|
public:
|
||||||
X() = delete;
|
X() = delete;
|
||||||
X(const X&) = default;
|
X(const X&) = default;
|
||||||
X(X&&) = default;
|
X(X&&) = default;
|
||||||
|
|||||||
Reference in New Issue
Block a user