Replace virtual dispatch with normal functions in buffers

This commit is contained in:
Victor Zverovich
2024-01-02 07:02:20 -08:00
parent 74ffea0dcf
commit 63ce170853
6 changed files with 69 additions and 65 deletions
+3 -4
View File
@@ -135,8 +135,8 @@ TEST(ostream_test, write_to_ostream_max_size) {
struct test_buffer final : fmt::detail::buffer<char> {
explicit test_buffer(size_t size)
: fmt::detail::buffer<char>(nullptr, size, size) {}
void grow(size_t) override {}
: fmt::detail::buffer<char>([](buffer<char>&, size_t) {}, nullptr, size,
size) {}
} buffer(max_size);
struct mock_streambuf : std::streambuf {
@@ -292,8 +292,7 @@ TEST(ostream_test, closed_ofstream) {
struct unlocalized {};
auto operator<<(std::ostream& os, unlocalized)
-> std::ostream& {
auto operator<<(std::ostream& os, unlocalized) -> std::ostream& {
return os << 12345;
}