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:
Florian Bramer 2023-03-16 04:03:52 +01:00 committed by GitHub
parent 8e3723f18f
commit a3ae12b20e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 ...
};