mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Add public access modifier to examples
This commit is contained in:
parent
e6ac978f3a
commit
eb0707d7ae
|
@ -5968,6 +5968,7 @@ To prevent slicing, because the normal copy operations will copy only the base p
|
|||
##### Example
|
||||
|
||||
class B { // GOOD: base class suppresses copying
|
||||
public:
|
||||
B(const B&) = delete;
|
||||
B& operator=(const B&) = delete;
|
||||
virtual unique_ptr<B> clone() { return /* B object */; }
|
||||
|
@ -17865,6 +17866,7 @@ If you intend for a class to match a concept, verifying that early saves users p
|
|||
##### Example
|
||||
|
||||
class X {
|
||||
public:
|
||||
X() = delete;
|
||||
X(const X&) = default;
|
||||
X(X&&) = default;
|
||||
|
|
Loading…
Reference in New Issue
Block a user