Skip to content

fmt() macro in format_to #783

Closed
Closed
@eglimi

Description

@eglimi

The fmt() macro is very useful to check if arguments are valid. As far as I can see, this is only possible for format. E.g. (from the documentation):

std::string s = fmt::format(fmt("{:d}"), "foo"); // Produces compiler error

I would like to be able to use the macro also in format_to, in order to avoid allocations from std::string. For example

fmt::memory_buffer buf;
fmt::format_to(buf, fmt("{:d}"), "foo");

Is this planned, or do I miss something?

Thank you for your support and the great work on fmtlib!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions