Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 308 Bytes

c++11_cast.md

File metadata and controls

17 lines (13 loc) · 308 Bytes

c++11 cast

static_cast

enum与int型转换

enum class ETileType : uint8
{
ENone, ESurface, ESubsurface, EPlatform, EHole, EEnd
};
uint8 n = FMath::RandRange(static_cast<int>(ETileType::ESurface), static_cast<int>(ETileType::EEnd) - 1);
ETileType NewTile = static_cast<ETileType>(n);