You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**operator Interface**<strong>\*</strong> Returns the encapsulated interface pointer, which may be NULL.
28
+
- **`operator Interface*`** Returns the encapsulated interface pointer, which may be NULL.
28
29
29
-
-**operator Interface&** Returns a reference to the encapsulated interface pointer, and issues an error if the pointer is NULL.
30
+
- **`operator Interface&`** Returns a reference to the encapsulated interface pointer, and issues an error if the pointer is NULL.
30
31
31
-
-**operator**<strong>\*</strong> Allows a smart pointer object to act as though it were the actual encapsulated interface when dereferenced.
32
+
- **`operator*`** Allows a smart pointer object to act as though it were the actual encapsulated interface when dereferenced.
32
33
33
-
-**operator->** Allows a smart pointer object to act as though it were the actual encapsulated interface when dereferenced.
34
+
- **`operator->`** Allows a smart pointer object to act as though it were the actual encapsulated interface when dereferenced.
34
35
35
-
-**operator&** Releases any encapsulated interface pointer, replacing it with NULL, and returns the address of the encapsulated pointer. This allows the smart pointer to be passed by address to a function that has an *out* parameter through which it returns an interface pointer.
36
+
- **`operator&`** Releases any encapsulated interface pointer, replacing it with NULL, and returns the address of the encapsulated pointer. This operator allows you to pass the smart pointer by address to a function that has an *out* parameter through which it returns an interface pointer.
36
37
37
-
-**operator bool** Allows a smart pointer object to be used in a conditional expression. This operator returns TRUE if the pointer is not NULL.
38
+
- **`operator bool`** Allows a smart pointer object to be used in a conditional expression. This operator returns TRUE if the pointer isn't NULL.
38
39
39
-
**END Microsoft Specific**
40
+
> [!NOTE]
41
+
> Because **`operator bool`** is not declared as **`explicit`**, `_com_ptr_t` is implicitly convertible to **`bool`**, which is convertible to any scalar type. This can have unexpected consequences in your code. Enable [Compiler Warning (level 4) C4800](../error-messages/compiler-warnings/compiler-warning-level-3-c4800.md) to prevent unintentional use of this conversion.
0 commit comments