This commit is contained in:
Frank B. Brokken 2016-11-09 09:11:41 +01:00
parent 75d04f6683
commit 274f0de867
5 changed files with 5 additions and 5 deletions

View file

@ -1,7 +1,7 @@
As we've seen, classes by default offer a copy constructor and assignment
operator. These class members are implemented so as to provide basic support:
data members of primitive data types are copied byte-by-byte, but for class
type data members their corresponding coy constructors c.q. assignment
type data members their corresponding copy constructors c.q. assignment
operators are called.
The compiler can provide default implementations for move constructors and

View file

@ -75,7 +75,7 @@ implementations of the functions expecting a tt(T const &) parameter. Since
the temporary can apparently not be modified a function defining a tt(T const
&&) parameter has no alternative but to copy the temporary's resources. As
this task is already performed by functions expecting a tt(T const &), there
is no need for implenting functions expecting tt(T const &&) parameters.
is no need for implementing functions expecting tt(T const &&) parameters.
As we've seen the move constructor grabs the information from a temporary
for its own use. That is OK as the temporary is going to be destroyed after

View file

@ -1,6 +1,6 @@
Here are some general rules to apply when designing classes offering value
semantics (i.e., classes whose objects can be used to initialize other
objectes of their class and that can be asssigned to other objects of their
objects of their class and that can be asssigned to other objects of their
class):
itemization(
it() Classes using pointers to dynamically allocated memory, owned by the

View file

@ -110,7 +110,7 @@ assignment operator:
How should the compound addition assignment operator be implemented? When
implementing compound binary assignment operators the strong guarantee should
always be kept in mind: if the operation might throw use a temporary object
and swap. Here is our first implementation of a compund assignment operator:
and swap. Here is our first implementation of a compound assignment operator:
verb(
// first implementation: modified in the next section
Binary &Binary::operator+=(Binary const &other)

View file

@ -82,7 +82,7 @@ Section ref(UDL) provides the details of this type of literal operator.
Arguments to literal operators are themselves always constants. A literal
operator like tt(_NM2km) cannot be used to convert, e.g., the value of a
variable. A literal operator, although it is defined as functinon, cannot be
variable. A literal operator, although it is defined as a function, cannot be
called like a function. The following examples therefore
result in compilation errors:
verb(