mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fixed typo (#2055)
Section C.21 shows a code example which typed a class name in two different ways: - CloneableBase - ClonableBase It is easy to overlook but it would not compile. My commit prefers CloneableBase over ClonableBase and uses just that name then. I prefered CloneableBase because Java's SDK uses the same writing, so I guess this can be consired to be more widely used.
This commit is contained in:
parent
8e3723f18f
commit
a3ae12b20e
|
@ -4945,15 +4945,15 @@ defined as defaulted.
|
|||
To prevent slicing as per [C.67](#Rc-copy-virtual),
|
||||
make the copy and move operations protected or `=delete`d, and add a `clone`:
|
||||
|
||||
class ClonableBase {
|
||||
class CloneableBase {
|
||||
public:
|
||||
virtual unique_ptr<ClonableBase> clone() const;
|
||||
virtual ~ClonableBase() = default;
|
||||
virtual unique_ptr<CloneableBase> clone() const;
|
||||
virtual ~CloneableBase() = default;
|
||||
CloneableBase() = default;
|
||||
ClonableBase(const ClonableBase&) = delete;
|
||||
ClonableBase& operator=(const ClonableBase&) = delete;
|
||||
ClonableBase(ClonableBase&&) = delete;
|
||||
ClonableBase& operator=(ClonableBase&&) = delete;
|
||||
CloneableBase(const CloneableBase&) = delete;
|
||||
CloneableBase& operator=(const CloneableBase&) = delete;
|
||||
CloneableBase(CloneableBase&&) = delete;
|
||||
CloneableBase& operator=(CloneableBase&&) = delete;
|
||||
// ... other constructors and functions ...
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user