- Mastering macOS Programming
- Stuart Grimshaw
- 56字
- 2025-04-04 19:10:25
Replacing classes
We have seen that enum types can be powerful and useful constructs, and in many cases they will replace classes as the go-to data structure. Where value-passing semantics are needed instead of reference passing, and where no inheritance is needed, it's always worth considering whether an enum is, in fact, all that is needed.