microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Public Types | List of all members
microfmt::detail::fix_type< T > Struct Template Reference

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
 

Detailed Description

template<typename T>
struct microfmt::detail::fix_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.

Member Typedef Documentation

◆ type

template<typename T >
using microfmt::detail::fix_type< T >::type = T

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