managarm / frigg

Lightweight C++ utilities and algorithms for system programming
MIT License
56 stars 20 forks source link

formatting: support formatting characters #52

Closed ilobilo closed 1 year ago

ilobilo commented 1 year ago

this pr adds support for formatting characters and fixes this warning on clang 15:

builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead

Example:

frg::fmt("character: {:c}, int: {}, int: {}, int: 0x{:X}", 'c', uint8_t('c'), 'c', 'c');
character: c, int: 99, int: 99, int 0x63