mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-03 07:31:41 +01:00
Add support for nonconiguous iterators
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -1908,3 +1909,9 @@ TEST(FormatTest, FormatStringErrors) {
|
||||
TEST(FormatTest, ToString) {
|
||||
EXPECT_EQ("42", fmt::to_string(42));
|
||||
}
|
||||
|
||||
TEST(WriterTest, NoncontiguousIterator) {
|
||||
std::list<char> out;
|
||||
fmt::format_to(std::back_inserter(out), "{}", 42);
|
||||
EXPECT_EQ("42", std::string(out.begin(), out.end()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user