Improve compatibility with old compilers and fix test

This commit is contained in:
Victor Zverovich 2017-01-22 12:16:16 -08:00
parent aea5d3ab00
commit aaa0fc396b
2 changed files with 5 additions and 3 deletions

View File

@ -1655,14 +1655,16 @@ class format_spec {
T value() const { return value_; }
};
// template <typename Char>
// using fill_spec = format_spec<Char, fill_tag>;
template <typename Char>
class fill_spec : public format_spec<Char, fill_tag> {
public:
explicit fill_spec(Char value) : format_spec<Char, fill_tag>(value) {}
};
using width_spec = format_spec<unsigned, width_tag>;
using type_spec = format_spec<char, type_tag>;
typedef format_spec<unsigned, width_tag> width_spec;
typedef format_spec<char, type_tag> type_spec;
class fill_spec_factory {
public:

View File

@ -781,7 +781,7 @@ TEST(UtilTest, WindowsError) {
TEST(UtilTest, ReportWindowsError) {
fmt::MemoryWriter out;
fmt::internal::format_windows_error(out, ERROR_FILE_EXISTS, "test error");
out << '\n';
out.write('\n');
EXPECT_WRITE(stderr,
fmt::report_windows_error(ERROR_FILE_EXISTS, "test error"), out.str());
}