@@ -5724,13 +5724,13 @@ Such as on an ABI (link) boundary.
5724
5724
};
5725
5725
5726
5726
class D2 : public Device {
5727
- // ... differnt data ...
5727
+ // ... different data ...
5728
5728
5729
5729
void write(span<const char> outbuf) override;
5730
5730
void read(span<char> inbuf) override;
5731
5731
};
5732
5732
5733
- A user can now use `D1`s and `D2`s interrchangeably through the interface provided by `Device`.
5733
+ A user can now use `D1`s and `D2`s interchangeably through the interface provided by `Device`.
5734
5734
Furthermore, we can update `D1` and `D2` in a ways that are not binarily compatible with older versions as long as all access goes through `Device`.
5735
5735
5736
5736
##### Enforcement
@@ -6730,7 +6730,7 @@ Readability. Convention. Reusability. Support for generic code
6730
6730
return os << /* class members here */;
6731
6731
}
6732
6732
6733
- By itself, `cout_my_class` would be OK, but it is not usable/composabe with code that rely on the `<<` convention for output:
6733
+ By itself, `cout_my_class` would be OK, but it is not usable/composable with code that rely on the `<<` convention for output:
6734
6734
6735
6735
My_class var { /* ... */ };
6736
6736
// ...
@@ -10854,7 +10854,7 @@ Let cleanup actions on the unwinding path be handled by [RAII](#Re-raii).
10854
10854
10855
10855
This code is messy.
10856
10856
There could be a leak from the naked pointer in the `try` block.
10857
- Not all exceptiones are handled.
10857
+ Not all exceptions are handled.
10858
10858
`deleting` an object that failed to construct is almost certainly a mistake.
10859
10859
Better:
10860
10860
@@ -10901,8 +10901,8 @@ Even without exceptions, [RAII](#Re-raii) is usually the best and most systemati
10901
10901
##### Note
10902
10902
10903
10903
Error handling using exceptions is the only complete and systematic way of handling non-local errors in C++.
10904
- In particular, non-intrusively signalling failure to construct an object requires an exception.
10905
- Signalling errors in a way that cannot be ignored requires exceptions.
10904
+ In particular, non-intrusively signaling failure to construct an object requires an exception.
10905
+ Signaling errors in a way that cannot be ignored requires exceptions.
10906
10906
If you can't use exceptions, simulate their use as best you can.
10907
10907
10908
10908
A lot of fear of exceptions is misguided.
@@ -11078,7 +11078,7 @@ and to avoid confusion with other uses of `std::pair`.
11078
11078
11079
11079
###### Example
11080
11080
11081
- In general, you must clean up before an eror exit.
11081
+ In general, you must clean up before an error exit.
11082
11082
This can be messy:
11083
11083
11084
11084
std::pair<int,error_indicator> user()
@@ -11108,7 +11108,7 @@ This can be messy:
11108
11108
}
11109
11109
11110
11110
Simulating RAII can be non-trivial, especially in functions with multiple resources and multiple possible errors.
11111
- A not uncommon technique is to gather cleanup at the end of the function to avoid repetittion :
11111
+ A not uncommon technique is to gather cleanup at the end of the function to avoid repetition :
11112
11112
11113
11113
std::pair<int,error_indicator> user()
11114
11114
{
@@ -11139,7 +11139,7 @@ A not uncommon technique is to gather cleanup at the end of the function to avoi
11139
11139
}
11140
11140
11141
11141
The larger the function, the more tempting this technique becomes.
11142
- Aso , the larger the program becomes the harder it is to apply an error-indicator-based error handling strategy systematically.
11142
+ Also , the larger the program becomes the harder it is to apply an error-indicator-based error handling strategy systematically.
11143
11143
11144
11144
We [prefer exception-based error handling](#Re-throw) and recommend [keeping functions short](#Rf-single).
11145
11145
@@ -11164,7 +11164,7 @@ See also [Simulating RAII](#Re-no-throw-raii).
11164
11164
11165
11165
##### Note
11166
11166
11167
- C-stye error handling is based on the global variable `errno`, so it is essentially impossible to avoid this style completely.
11167
+ C-style error handling is based on the global variable `errno`, so it is essentially impossible to avoid this style completely.
11168
11168
11169
11169
##### Enforcement
11170
11170
@@ -12025,9 +12025,9 @@ In general, passing function objects gives better performance than passing point
12025
12025
auto y = find_if(v, [](double x) { return x>7; }); // function object: carries the needed data
12026
12026
auto z = find_if(v, Greater_than<double>(7)); // function object: carries the needed data
12027
12027
12028
- You can, of course, gneralize those functions using `auto` or (when and where available) concepts. For example:
12028
+ You can, of course, generalize those functions using `auto` or (when and where available) concepts. For example:
12029
12029
12030
- auto y1 = find_if(v, [](Ordered x) { return x>7; }); // reruire an ordered type
12030
+ auto y1 = find_if(v, [](Ordered x) { return x>7; }); // require an ordered type
12031
12031
auto z1 = find_if(v, [](auto x) { return x>7; }); // hope that the type has a >
12032
12032
12033
12033
##### Note
@@ -12215,7 +12215,7 @@ Flag uses where an explicitly specialized type exactly matches the types of the
12215
12215
X(X&&); // move
12216
12216
X& operator=(X&&);
12217
12217
~X();
12218
- // ... no moreconstructors ...
12218
+ // ... no more constructors ...
12219
12219
};
12220
12220
12221
12221
X x {1}; // fine
@@ -12247,7 +12247,7 @@ Semiregular requires default constructible.
12247
12247
}
12248
12248
12249
12249
namespace T0 {
12250
- bool operator==(int, Bad::S) { cout << "T0\n"; return true; } // compate to int
12250
+ bool operator==(int, Bad::S) { cout << "T0\n"; return true; } // compare to int
12251
12251
12252
12252
void test()
12253
12253
{
0 commit comments