Fix container adaptor formatting

This commit is contained in:
Victor Zverovich
2023-02-10 09:45:27 -08:00
parent 581c6292c9
commit 655046d24f
2 changed files with 17 additions and 13 deletions

View File

@@ -12,10 +12,10 @@
#include "fmt/ranges.h"
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include "gtest/gtest.h"
@@ -447,10 +447,8 @@ TEST(ranges_test, container_adaptor) {
std::stack<char, std::string> s;
s.push('a');
s.push('b');
// Note: The output is formatted as a string because the underlying
// container is a string. This behavior is conforming to the standard
// [container.adaptors.format].
EXPECT_EQ(fmt::format("{}", s), "ab");
// See https://cplusplus.github.io/LWG/issue3881.
EXPECT_EQ(fmt::format("{}", s), "['a', 'b']");
}
{