Fix detail::write with fallback formatter (#1829)

* add support for fallback_formatter in detail::write

* add ToString test into OStreamTest

to check fmt::to_string() with class that has output stream operator

* add WithOstreamOperator test into CompileTest

to check fmt::format() with FMT_COMPILE() and class that has output stream operator

* use conditional_t inside detail::write instead of 2 overloads

* Revert "add WithOstreamOperator test into CompileTest"

* remove Context from template parameters in detail::write
This commit is contained in:
Alexey Ochapov
2020-08-20 16:41:09 +03:00
committed by GitHub
parent 06895a7687
commit 1651b2d433
2 changed files with 11 additions and 2 deletions

View File

@@ -319,3 +319,7 @@ TEST(OStreamTest, CopyFmt) {
TEST(OStreamTest, CompileTimeString) {
EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), 42));
}
TEST(OStreamTest, ToString) {
EXPECT_EQ("ABC", fmt::to_string(fmt_test::ABC()));
}