SofaBuffers C/C++ 0.12.0
API Documentation
Loading...
Searching...
No Matches
sofab::wire_int< E, bool > Struct Template Reference

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
 

Detailed Description

template<typename E, bool = std::is_enum_v<E>>
struct sofab::wire_int< E, bool >

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.

Definition at line 160 of file sofab.hpp.

Member Typedef Documentation

◆ type

template<typename E , bool = std::is_enum_v<E>>
using sofab::wire_int< E, bool >::type = E

Definition at line 160 of file sofab.hpp.


The documentation for this struct was generated from the following file: