diff --git a/inc/format.h b/inc/format.h index 0446e90..814607d 100644 --- a/inc/format.h +++ b/inc/format.h @@ -103,7 +103,7 @@ constexpr char_array_t format_args(char_array_t result, first_arg_t first_arg, template -std::array()> format(args_t... args) { +constexpr std::array()> format(args_t... args) { constexpr auto parse_result = detail::parse_string(); static_assert(parse_result.is_valid, "Syntax error in format string"); diff --git a/src/main.cpp b/src/main.cpp index 5fb0e56..a6c2d26 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,7 +12,7 @@ public: int main() { - const auto formatted = format<"Test: {:3.8f} {:5.5} {:05.2}">(3.4, "abc", 1234); + constexpr auto formatted = format<"Test: {:3.8f} {:5.5} {:05.2}">(3.4, "abc", 1234); for (const auto& c : formatted) std::cout << c;