Hi, per swift/TypeLayout.rst at main · apple/swift · GitHub
enum Type: Int32 {
}
only matters to the rawValue type. Its memory layout is not impacted by the choice of the rawValue representation.
For me, there are some benefits of define exactly what sizes my enum going to occupy (better C interoperability, for one). Currently, I use @objc annotation to support that.
This has worked so far (with some downside, such as description
are not as descriptive as naked enum), but want to get opinions from community whether this is a good choice and whether there are any guarantees provided with this workaround. Thanks.
(To see why and what exactly: swift-mujoco/Mjt.swift at main · liuliu/swift-mujoco · GitHub)