mirror of
https://github.com/fmtlib/fmt.git
synced 2025-08-01 19:54:46 +02:00
Remove FMT_USE_VARIADIC_TEMPLATES
This commit is contained in:
@@ -83,7 +83,6 @@ def build_docs(version='dev', **kwargs):
|
|||||||
ALIASES += "endrst=\endverbatim"
|
ALIASES += "endrst=\endverbatim"
|
||||||
MACRO_EXPANSION = YES
|
MACRO_EXPANSION = YES
|
||||||
PREDEFINED = _WIN32=1 \
|
PREDEFINED = _WIN32=1 \
|
||||||
FMT_USE_VARIADIC_TEMPLATES=1 \
|
|
||||||
FMT_USE_RVALUE_REFERENCES=1 \
|
FMT_USE_RVALUE_REFERENCES=1 \
|
||||||
FMT_USE_USER_DEFINED_LITERALS=1 \
|
FMT_USE_USER_DEFINED_LITERALS=1 \
|
||||||
FMT_API=
|
FMT_API=
|
||||||
|
@@ -455,7 +455,6 @@ TEST(FormatterTest, ArgErrors) {
|
|||||||
EXPECT_THROW_MSG(format(format_str), format_error, "number is too big");
|
EXPECT_THROW_MSG(format(format_str), format_error, "number is too big");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FMT_USE_VARIADIC_TEMPLATES
|
|
||||||
template <int N>
|
template <int N>
|
||||||
struct TestFormat {
|
struct TestFormat {
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
@@ -478,12 +477,11 @@ TEST(FormatterTest, ManyArgs) {
|
|||||||
format_error, "argument index out of range");
|
format_error, "argument index out of range");
|
||||||
EXPECT_THROW_MSG(TestFormat<21>::format("{21}"),
|
EXPECT_THROW_MSG(TestFormat<21>::format("{21}"),
|
||||||
format_error, "argument index out of range");
|
format_error, "argument index out of range");
|
||||||
enum { MAX_PACKED_ARGS = fmt::ArgList::MAX_PACKED_ARGS };
|
enum { MAX_PACKED_ARGS = fmt::internal::MAX_PACKED_ARGS };
|
||||||
std::string format_str = fmt::format("{{{}}}", MAX_PACKED_ARGS + 1);
|
std::string format_str = fmt::format("{{{}}}", MAX_PACKED_ARGS + 1);
|
||||||
EXPECT_THROW_MSG(TestFormat<MAX_PACKED_ARGS>::format(format_str),
|
EXPECT_THROW_MSG(TestFormat<MAX_PACKED_ARGS>::format(format_str),
|
||||||
format_error, "argument index out of range");
|
format_error, "argument index out of range");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
TEST(FormatterTest, NamedArg) {
|
TEST(FormatterTest, NamedArg) {
|
||||||
EXPECT_EQ("1/a/A", format("{_1}/{a_}/{A_}", fmt::arg("a_", 'a'),
|
EXPECT_EQ("1/a/A", format("{_1}/{a_}/{A_}", fmt::arg("a_", 'a'),
|
||||||
@@ -1451,14 +1449,12 @@ TEST(FormatTest, FormatMessageExample) {
|
|||||||
format_message(42, "{} happened", "something"));
|
format_message(42, "{} happened", "something"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FMT_USE_VARIADIC_TEMPLATES
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
void print_error(const char *file, int line, const char *format,
|
void print_error(const char *file, int line, const char *format,
|
||||||
const Args & ... args) {
|
const Args & ... args) {
|
||||||
fmt::print("{}: {}: ", file, line);
|
fmt::print("{}: {}: ", file, line);
|
||||||
fmt::print(format, args...);
|
fmt::print(format, args...);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
TEST(FormatTest, UnpackedArgs) {
|
TEST(FormatTest, UnpackedArgs) {
|
||||||
EXPECT_EQ("0123456789abcdefg",
|
EXPECT_EQ("0123456789abcdefg",
|
||||||
|
Reference in New Issue
Block a user