正常
Type Safety
C-era enums, unions, and raw pointers leave behind too many type safety pitfalls—implicit conversions, undefined behavior (UB), null pointer dereferences... Modern C++ provides a suite of tools to plug these holes. In this chapter, we explore how enum class puts an end to the nightmare of implicit enum conversions, how strong-typed typedefs prevent parameter mix-ups, how variant safely replaces unions, how optional elegantly expresses "possibly no value," and how any achieves type erasure when needed.