Skip to content

Commit 37b6d94

Browse files
Create c++11_cast.md
1 parent 1696d0d commit 37b6d94

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

c++11_cast.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# c++11 cast
2+
3+
## static_cast
4+
5+
enum与int型转换
6+
7+
```
8+
enum class ETileType : uint8
9+
{
10+
ENone, ESurface, ESubsurface, EPlatform, EHole, EEnd
11+
};
12+
```
13+
14+
```
15+
uint8 n = FMath::RandRange(static_cast<int>(ETileType::ESurface), static_cast<int>(ETileType::EEnd) - 1);
16+
ETileType NewTile = static_cast<ETileType>(n);
17+
```

0 commit comments

Comments
 (0)