Skip to content

Commit 9f197b2

Browse files
authored
Make FMT_STRING redundant when FMT_USE_CONSTEVAL is enabled (#4612)
1 parent f20b166 commit 9f197b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/fmt/format.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4257,7 +4257,11 @@ class format_int {
42574257
* // A compile-time error because 'd' is an invalid specifier for strings.
42584258
* std::string s = fmt::format(FMT_STRING("{:d}"), "foo");
42594259
*/
4260-
#define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string)
4260+
#if FMT_USE_CONSTEVAL
4261+
# define FMT_STRING(s) s
4262+
#else
4263+
# define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string)
4264+
#endif // FMT_USE_CONSTEVAL
42614265

42624266
FMT_API auto vsystem_error(int error_code, string_view fmt, format_args args)
42634267
-> std::system_error;

0 commit comments

Comments
 (0)