Skip to content

Formattable types - #47

Draft
CrackedMatter wants to merge 2 commits into
BasedInc:masterfrom
CrackedMatter:formattable_types
Draft

Formattable types#47
CrackedMatter wants to merge 2 commits into
BasedInc:masterfrom
CrackedMatter:formattable_types

Conversation

@CrackedMatter

@CrackedMatter CrackedMatter commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Formatting support for libhat types.

  • Generic hat::formatter
    • std::formatter specialization is provided
    • fmt::formatter can be specialized by the user (see libfmt example)
  • Supported libhat types:
    • fixed_string
    • string_literal
    • cstring_view
    • cow (if the underlying non-owning type is formattable)
    • signature_element
    • signature
    • signature_view
    • fixed_signature

To-do:

  • Support more types
  • Make signature formatters more efficient by writing to ctx.out() directly

Note: There is a compilation error when trying to call .viewed() on a cow_writable_span that needs to be investigated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant