Skip to content

Commit bf5eae4

Browse files
author
mtx48109
committed
cpp formatting review pr18
1 parent 4dd72c1 commit bf5eae4

30 files changed

+45
-69
lines changed

docs/cpp/general-rules-and-limitations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ ms.workload: ["cplusplus"]
8585

8686
**END Microsoft Specific**
8787

88-
## See Also
88+
## See also
8989
[dllexport, dllimport](../cpp/dllexport-dllimport.md)

docs/cpp/general-rules-for-operator-overloading.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The following rules constrain how overloaded operators are implemented. However,
4949

5050
- Overloaded operators cannot have default arguments.
5151

52-
- All overloaded operators except assignment (`operator=`) are inherited by derived classes.
52+
- All overloaded operators except assignment (**operator=**) are inherited by derived classes.
5353

5454
- The first argument for member-function overloaded operators is always of the class type of the object for which the operator is invoked (the class in which the operator is declared, or a class derived from that class). No conversions are supplied for the first argument.
5555

@@ -62,10 +62,10 @@ var++;
6262
++var;
6363
```
6464

65-
This identity cannot be relied upon for class types that overload operators. Moreover, some of the requirements implicit in the use of these operators for basic types are relaxed for overloaded operators. For example, the addition/assignment operator, `+=`, requires the left operand to be an l-value when applied to basic types; there is no such requirement when the operator is overloaded.
65+
This identity cannot be relied upon for class types that overload operators. Moreover, some of the requirements implicit in the use of these operators for basic types are relaxed for overloaded operators. For example, the addition/assignment operator, **+=**, requires the left operand to be an l-value when applied to basic types; there is no such requirement when the operator is overloaded.
6666

6767
> [!NOTE]
6868
> For consistency, it is often best to follow the model of the built-in types when defining overloaded operators. If the semantics of an overloaded operator differ significantly from its meaning in other contexts, it can be more confusing than useful.
6969

70-
## See Also
70+
## See also
7171
[Operator Overloading](../cpp/operator-overloading.md)

docs/cpp/goto-statement-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ Outer loop executing. i = 3
7474
Jumped to stop. i = 3
7575
```
7676

77-
## See Also
77+
## See also
7878
[Jump Statements](../cpp/jump-statements-cpp.md)
7979
[Keywords](../cpp/keywords-cpp.md)

docs/cpp/hardware-exceptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ Most of the standard exceptions recognized by the operating system are hardware-
3535

3636
Many of the exceptions listed in the previous table are intended to be handled by debuggers, the operating system, or other low-level code. With the exception of integer and floating-point errors, your code should not handle these errors. Thus, you should usually use the exception-handling filter to ignore exceptions (evaluate to 0). Otherwise, you may prevent lower-level mechanisms from responding appropriately. You can, however, take appropriate precautions against the potential effect of these low-level errors by [writing termination handlers](../cpp/writing-a-termination-handler.md).
3737

38-
## See Also
38+
## See also
3939
[Writing an Exception Handler](../cpp/writing-an-exception-handler.md)
4040
[Structured Exception Handling (C/C++)](../cpp/structured-exception-handling-c-cpp.md)

docs/cpp/header-files-cpp.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,24 @@ After the compiler finishes compiling each .cpp file into .obj files, it passes
8282

8383
## Include guards
8484

85-
Typically, header files have an *include guard* or a **#pragma once** directive to ensure that they are not inserted multiple times into a single .cpp file.
85+
Typically, header files have an *include guard* or a `#pragma once` directive to ensure that they are not inserted multiple times into a single .cpp file.
8686

87+
```cpp
8788
// my_class.h
8889
#ifndef MY_CLASS_H // include guard
8990
#define MY_CLASS_H
9091

91-
9292
namespace N
9393
{
9494
class my_class
9595
{
9696
public:
9797
void do_something();
9898
};
99-
10099
}
101100

102101
#endif /* MY_CLASS_H */
102+
```
103103

104104
## What to put in a header file
105105

@@ -125,15 +125,13 @@ The following example shows the various kinds of declarations and definitions th
125125

126126
namespace N // namespace declaration
127127
{
128-
129128
inline namespace P
130129
{
131130
//...
132131
}
133132

134133
enum class colors : short { red, blue, purple, azure };
135134

136-
137135
const double PI = 3.14; // const and constexpr definitions
138136
constexpr int MeaningOfLife{ 42 };
139137
constexpr int get_meaning()
@@ -150,7 +148,6 @@ namespace N // namespace declaration
150148
void print_to_log();
151149
#endif
152150

153-
154151
class my_class // regular class definition,
155152
{ // but no non-inline function definitions
156153

@@ -186,5 +183,5 @@ namespace N // namespace declaration
186183

187184
template <typename T> // template declaration
188185
class value_widget;
189-
190186
}
187+
```

docs/cpp/hook.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Associates a handler method with an event.
1818
## Syntax
1919

2020
```
21-
2221
long __hook(
2322
&SourceClass::EventMethod,
2423
source,
@@ -91,7 +90,7 @@ long __hook(
9190
## Example
9291
See [Event Handling in Native C++](../cpp/event-handling-in-native-cpp.md) and [Event Handling in COM](../cpp/event-handling-in-com.md) for samples.
9392

94-
## See Also
93+
## See also
9594
[Keywords](../cpp/keywords-cpp.md)
9695
[Event Handling](../cpp/event-handling.md)
9796
[event_source](../windows/event-source.md)

docs/cpp/how-catch-blocks-are-evaluated-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ catch( CExcptClass E )
5959

6060
In this example, the ellipsis **catch** handler is the only handler that is examined.
6161

62-
## See Also
62+
## See also
6363
[C++ Exception Handling](../cpp/cpp-exception-handling.md)

docs/cpp/how-to-create-and-use-ccomptr-and-ccomqiptr-instances.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ In classic Windows programming, libraries are often implemented as COM objects (
3232

3333
[!code-cpp[COM_smart_pointers#03](../cpp/codesnippet/CPP/how-to-create-and-use-ccomptr-and-ccomqiptr-instances_3.cpp)]
3434

35-
## See Also
35+
## See also
3636
[Smart Pointers](../cpp/smart-pointers-modern-cpp.md)

docs/cpp/how-to-create-and-use-shared-ptr-instances.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ The `shared_ptr` type is a smart pointer in the C++ standard library that is des
5757

5858
[!code-cpp[stl_smart_pointers#3](../cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_6.cpp)]
5959

60-
## See Also
60+
## See also
6161
[Smart Pointers](../cpp/smart-pointers-modern-cpp.md)

docs/cpp/how-to-create-and-use-unique-ptr-instances.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ A [unique_ptr](../standard-library/unique-ptr-class.md) does not share its point
4545

4646
For more examples, see [make_unique](../standard-library/memory-functions.md#make_unique).
4747

48-
## See Also
48+
## See also
4949
[Smart Pointers](../cpp/smart-pointers-modern-cpp.md)
50-
[make_unique](../standard-library/memory-functions.md#make_unique)
50+
[make_unique](../standard-library/memory-functions.md#make_unique)

0 commit comments

Comments
 (0)