|
SofaBuffers C/C++ 0.12.0
API Documentation
|
The integer type an element travels as on the wire: identity for an integer, the declared underlying type for an enumeration. More...
#include <sofab.hpp>
Public Types | |
| using | type = E |
The integer type an element travels as on the wire: identity for an integer, the declared underlying type for an enumeration.
An enum's declared width is what picks the signed or unsigned array wire type and the zig-zag transform (MESSAGE_SPEC §1). The enumeration itself cannot answer that: std::is_signed_v and std::is_unsigned_v are both false for every enumeration type, so a rule keyed off the element would call every enum array unsigned and quietly drop the transform from each negative constant.
The partial specialization is what keeps it lazy. std::conditional_t would instantiate std::underlying_type_t<E> for a plain integer too, and that has no type — every existing integer array would stop compiling.