Skip to content

Enable constexpr support on format  #3403

@bebuch

Description

@bebuch

I just tried calling fmt::format in a constexpr context (static_assert) and found that it doesn't work. Since C++20 has constexpr support for std::string, it should also be possible to add constexpr support to fmt::format.

#include <string_view>
#include <fmt/core.h>

using namespace std::literals;
static_assert(fmt::format("{}", 5) == "5"sv);

Is there anything against this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions