I am writing a class which, accepting the answer Is the type of enumerated types compatible with their base type? is yes, compatible with struct kevent , but uses enum class es for filter , flags , etc. with the corresponding base types for the corresponding fields. This is also a standard layout (all private fields and all standard layouts by themselves, no virtual elements, no base classes). From my reading of n3690 I can determine that my class and struct kevent have the same representation of values, but I don't see anything in the standard, so I can reinterpret_cast between them, although this seems like a reasonable interpretation of the “value representation”. Is it technically permitted by the standard? If not, what gives you an idea of ​​the value of the type value?
EDIT 2014/02/24 16:45 EST . In response to the comment, I must clarify that I want the reinterpret_cast first class to refer to the second, as, of course, you cannot directly reinterpret_cast use a non-pointer type for another type of non-pointer.
source share