remove FMT_ENABLE_FALLBACK_TO_RUNTIME_API
This commit is contained in:
parent
0c5bb0fcf1
commit
46f2173388
@ -22,10 +22,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef FMT_ENABLE_FALLBACK_TO_RUNTIME_API
|
||||
# define FMT_ENABLE_FALLBACK_TO_RUNTIME_API 1
|
||||
#endif
|
||||
|
||||
FMT_BEGIN_NAMESPACE
|
||||
namespace detail {
|
||||
|
||||
@ -708,12 +704,6 @@ constexpr auto compile(S format_str) {
|
||||
constexpr auto result =
|
||||
detail::compile_format_string<detail::type_list<Args...>, 0, 0>(
|
||||
format_str);
|
||||
# if !FMT_ENABLE_FALLBACK_TO_RUNTIME_API
|
||||
static_assert(!std::is_same<remove_cvref_t<decltype(result)>,
|
||||
detail::unknown_format>(),
|
||||
"format string is invalid for compile-time API, "
|
||||
"and fallback to runtime API is disabled");
|
||||
# endif
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,7 +229,6 @@ TEST(CompileTest, TextAndArg) {
|
||||
EXPECT_EQ("42!", fmt::format(FMT_COMPILE("{}!"), 42));
|
||||
}
|
||||
|
||||
# if FMT_ENABLE_FALLBACK_TO_RUNTIME_API
|
||||
TEST(CompileTest, UnknownFormatFallback) {
|
||||
EXPECT_EQ(" 42 ",
|
||||
fmt::format(FMT_COMPILE("{name:^4}"), fmt::arg("name", 42)));
|
||||
@ -246,7 +245,6 @@ TEST(CompileTest, UnknownFormatFallback) {
|
||||
EXPECT_EQ(buffer + 4, result.out);
|
||||
EXPECT_EQ(" 42 ", fmt::string_view(buffer, 4));
|
||||
}
|
||||
# endif
|
||||
|
||||
TEST(CompileTest, Empty) { EXPECT_EQ("", fmt::format(FMT_COMPILE(""))); }
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user