Skip to content

Commit ef3a835

Browse files
authored
Merge pull request MicrosoftDocs#1053 from msebolt/format-cpp-pr9
format cpp pr9
2 parents 91fbb97 + dde177e commit ef3a835

33 files changed

+182
-182
lines changed

docs/cpp/unhook.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ long __unhook(
4444

4545
- Managed events: *SourceClass* is the event source class and *EventMethod* is the event.
4646

47-
`interface`
48-
The interface name being unhooked from `receiver`, only for COM event receivers in which the *layout_dependent* parameter of the [event_receiver](../windows/event-receiver.md) attribute is **true**.
47+
*interface*
48+
The interface name being unhooked from *receiver*, only for COM event receivers in which the *layout_dependent* parameter of the [event_receiver](../windows/event-receiver.md) attribute is **true**.
4949

5050
*source*
5151
A pointer to an instance of the event source. Depending on the code `type` specified in **event_receiver**, *source* can be one of the following:
@@ -57,34 +57,34 @@ long __unhook(
5757
- A managed object pointer (for managed events).
5858

5959
**&** *ReceiverClass* `::` `HandlerMethod`
60-
A pointer to the event handler method to be unhooked from an event. The handler is specified as a method of a class or a reference to the same; if you do not specify the class name, `__unhook` assumes the class to be that in which it is called.
60+
A pointer to the event handler method to be unhooked from an event. The handler is specified as a method of a class or a reference to the same; if you do not specify the class name, **__unhook** assumes the class to be that in which it is called.
6161

6262
- Native C++ events: *ReceiverClass* is the event receiver class and `HandlerMethod` is the handler.
6363

6464
- COM events: *ReceiverClass* is the event receiver interface and `HandlerMethod` is one of its handlers.
6565

6666
- Managed events: *ReceiverClass* is the event receiver class and `HandlerMethod` is the handler.
6767

68-
`receiver`(optional)
69-
A pointer to an instance of the event receiver class. If you do not specify a receiver, the default is the receiver class or structure in which `__unhook` is called.
68+
*receiver*(optional)
69+
A pointer to an instance of the event receiver class. If you do not specify a receiver, the default is the receiver class or structure in which **__unhook** is called.
7070

7171
## Usage
7272
Can be use in any function scope, including main, outside the event receiver class.
7373

7474
## Remarks
75-
Use the intrinsic function `__unhook` in an event receiver to dissociate or "unhook" a handler method from an event method.
75+
Use the intrinsic function **__unhook** in an event receiver to dissociate or "unhook" a handler method from an event method.
7676

77-
There are three forms of `__unhook`. You can use the first (four-argument) form in most cases. You can use the second (two-argument) form of `__unhook` only for a COM event receiver; this unhooks the entire event interface. You can use the third (one-argument) form to unhook all delegates from the specified source.
77+
There are three forms of **__unhook**. You can use the first (four-argument) form in most cases. You can use the second (two-argument) form of **__unhook** only for a COM event receiver; this unhooks the entire event interface. You can use the third (one-argument) form to unhook all delegates from the specified source.
7878

7979
A nonzero return value indicates that an error has occurred (managed events will throw an exception).
8080

81-
If you call `__unhook` on an event and event handler that are not already hooked, it will have no effect.
81+
If you call **__unhook** on an event and event handler that are not already hooked, it will have no effect.
8282

8383
At compile time, the compiler verifies that the event exists and does parameter type checking with the specified handler.
8484

85-
With the exception of COM events, `__hook` and `__unhook` can be called outside the event receiver.
85+
With the exception of COM events, **__hook** and **__unhook** can be called outside the event receiver.
8686

87-
An alternative to using `__unhook` is to use the -= operator.
87+
An alternative to using **__unhook** is to use the -= operator.
8888

8989
For information on coding managed events in the new syntax, see [event](../windows/event-cpp-component-extensions.md).
9090

docs/cpp/uniform-initialization-and-delegating-constructors.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int main()
8282
}
8383
```
8484
85-
You can use brace initialization anywhere you would typically do initialization—for example, as a function parameter or a return value, or with the `new` keyword:
85+
You can use brace initialization anywhere you would typically do initialization—for example, as a function parameter or a return value, or with the **new** keyword:
8686
8787
```cpp
8888
class_d* cf = new class_d{4.5};

docs/cpp/unions.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.author: "mblome"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# Unions
16-
A `union` is a user-defined type in which all members share the same memory location. This means that at any given time a union can contain no more than one object from its list of members. It also means that no matter how many members a union has, it always uses only enough memory to store the largest member.
16+
A **union** is a user-defined type in which all members share the same memory location. This means that at any given time a union can contain no more than one object from its list of members. It also means that no matter how many members a union has, it always uses only enough memory to store the largest member.
1717

1818
Unions can be useful for conserving memory when you have lots of objects and/or limited memory. However they require extra care to use correctly because you are responsible for ensuring that you always access the last member that was written to. If any member types have a non-trivial constructor, then you must write additional code to explicitly construct and destroy that member. Before using a union, consider whether the problem you are trying to solve could be better expressed by using a base class and derived classes.
1919

@@ -24,16 +24,16 @@ union [name] { member-list };
2424
```
2525
2626
#### Parameters
27-
`name`
27+
*name*
2828
The type name given to the union.
2929
30-
`member-list`
30+
*member-list*
3131
Members that the union can contain. See Remarks.
3232
3333
## Remarks
3434
3535
## Declaring a Union
36-
Begin the declaration of a union with the `union` keyword, and enclose the member list in curly braces:
36+
Begin the declaration of a union with the **union** keyword, and enclose the member list in curly braces:
3737
3838
```cpp
3939
// declaring_a_union.cpp

docs/cpp/user-defined-literals-cpp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int main(int argc, char* argv[])
9494
}
9595
```
9696
97-
Note that the literal number must use a decimal, otherwise the number would be interpreted as an integer and the type would not be compatible with the operator. Also note that for floating point input, the type must be `long double`, and for integral types it must be `long long`.
97+
Note that the literal number must use a decimal, otherwise the number would be interpreted as an integer and the type would not be compatible with the operator. Also note that for floating point input, the type must be **long double**, and for integral types it must be **long long**.
9898
9999
## Raw literals
100100
In a raw user-defined literal, the operator that you define accepts the literal as a sequence of char values and it is up to you to interpret that sequence as a number or string or other type. In the list of operators shown earlier in this page, `_r` and `_t` can be used to define raw literals:

0 commit comments

Comments
 (0)