|
microfmt
Zero-allocation C++ formatting for constrained environments
|
Collapses argument types to a canonical representative before they reach format_type_table, so that types differing only in ways that format_type_thunk doesn't actually care about don't each generate their own thunk/table instantiation. More...
#include <microfmt.hpp>
Public Types | |
| using | type = T |
Collapses argument types to a canonical representative before they reach format_type_table, so that types differing only in ways that format_type_thunk doesn't actually care about don't each generate their own thunk/table instantiation.
String-literal arguments are the main offender: "hi" and "hello, world!" deduce to distinct types (char[3], char[14], ...), yet format_type_thunk always treats a bounded char array as "pointer to its first element" and never inspects the bound N, so every length is functionally identical. Collapsing them to a single-element array keeps the array-vs-pointer distinction (and constness) that format_type_thunk relies on while eliminating the combinatorial blowup of thunk/table specializations (and therefore binary size and compile time) across call sites using differently-sized string literals.
| using microfmt::detail::fix_type< T >::type = T |