Skip to content

Commit e910836

Browse files
committed
typo
1 parent 1863a75 commit e910836

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

CppCoreGuidelines.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5724,13 +5724,13 @@ Such as on an ABI (link) boundary.
57245724
};
57255725

57265726
class D2 : public Device {
5727-
// ... differnt data ...
5727+
// ... different data ...
57285728

57295729
void write(span<const char> outbuf) override;
57305730
void read(span<char> inbuf) override;
57315731
};
57325732

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`.
57345734
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`.
57355735

57365736
##### Enforcement
@@ -6730,7 +6730,7 @@ Readability. Convention. Reusability. Support for generic code
67306730
return os << /* class members here */;
67316731
}
67326732

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:
67346734

67356735
My_class var { /* ... */ };
67366736
// ...
@@ -10854,7 +10854,7 @@ Let cleanup actions on the unwinding path be handled by [RAII](#Re-raii).
1085410854

1085510855
This code is messy.
1085610856
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.
1085810858
`deleting` an object that failed to construct is almost certainly a mistake.
1085910859
Better:
1086010860

@@ -10901,8 +10901,8 @@ Even without exceptions, [RAII](#Re-raii) is usually the best and most systemati
1090110901
##### Note
1090210902

1090310903
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.
1090610906
If you can't use exceptions, simulate their use as best you can.
1090710907

1090810908
A lot of fear of exceptions is misguided.
@@ -11078,7 +11078,7 @@ and to avoid confusion with other uses of `std::pair`.
1107811078

1107911079
###### Example
1108011080

11081-
In general, you must clean up before an eror exit.
11081+
In general, you must clean up before an error exit.
1108211082
This can be messy:
1108311083

1108411084
std::pair<int,error_indicator> user()
@@ -11108,7 +11108,7 @@ This can be messy:
1110811108
}
1110911109

1111011110
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:
1111211112

1111311113
std::pair<int,error_indicator> user()
1111411114
{
@@ -11139,7 +11139,7 @@ A not uncommon technique is to gather cleanup at the end of the function to avoi
1113911139
}
1114011140

1114111141
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.
1114311143

1114411144
We [prefer exception-based error handling](#Re-throw) and recommend [keeping functions short](#Rf-single).
1114511145

@@ -11164,7 +11164,7 @@ See also [Simulating RAII](#Re-no-throw-raii).
1116411164

1116511165
##### Note
1116611166

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.
1116811168

1116911169
##### Enforcement
1117011170

@@ -12025,9 +12025,9 @@ In general, passing function objects gives better performance than passing point
1202512025
auto y = find_if(v, [](double x) { return x>7; }); // function object: carries the needed data
1202612026
auto z = find_if(v, Greater_than<double>(7)); // function object: carries the needed data
1202712027

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:
1202912029

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
1203112031
auto z1 = find_if(v, [](auto x) { return x>7; }); // hope that the type has a >
1203212032

1203312033
##### Note
@@ -12215,7 +12215,7 @@ Flag uses where an explicitly specialized type exactly matches the types of the
1221512215
X(X&&); // move
1221612216
X& operator=(X&&);
1221712217
~X();
12218-
// ... no moreconstructors ...
12218+
// ... no more constructors ...
1221912219
};
1222012220

1222112221
X x {1}; // fine
@@ -12247,7 +12247,7 @@ Semiregular requires default constructible.
1224712247
}
1224812248

1224912249
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
1225112251

1225212252
void test()
1225312253
{

0 commit comments

Comments
 (0)