mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
typos
This commit is contained in:
parent
75d04f6683
commit
274f0de867
5 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue