Skip to content

Commit f18870f

Browse files
authored
Merge pull request #3095 from JordanMaples/patch-8
Add example to C26493
2 parents b11f4bd + a618b98 commit f18870f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/code-quality/c26493.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@ ms.date: 03/22/2018
44
ms.topic: reference
55
f1_keywords: ["C26493"]
66
helpviewer_keywords: ["C26493"]
7+
description: CppCoreCheck rule that enforces C++ Core Guidelines Type.4
78
---
89
# C26493 NO_CSTYLE_CAST
910

10-
Don't use C-style casts. See [C++ Core Guidelines Type.4](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#SS-type).
11+
Don't use C-style casts.
12+
13+
## See also
14+
[C++ Core Guidelines Type.4](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#SS-type).
15+
16+
## Example
17+
```cpp
18+
void function(const int* const_i)
19+
{
20+
int* nonconst_i = (int*)const_i; // C26493 Don't use C-style casts
21+
int i = (int)*const_i; // C26493 Don't use C-style casts
22+
}
23+
```

0 commit comments

Comments
 (0)