diff --git a/fmt/format.h b/fmt/format.h index fc2dcd8f..48704d18 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -155,24 +155,6 @@ typedef __int64 intmax_t; # endif #endif -#ifndef FMT_USE_OSTREAM_RVALUE -// If non-zero, enables operator<< for BasicWriter&&, such that things like -// std::string s = (MemoryWriter() << "i = " << i).str(); -// are possible. -// -// (See: http://cplusplus.github.io/LWG/lwg-active.html#1203) -// -// XXX: -// I don't know if FMT_USE_RVALUE_REFERENCES is the correct way to enable -// this... It works for g++ 6.3 and VC15, though. -// -# if FMT_USE_RVALUE_REFERENCES -# define FMT_USE_OSTREAM_RVALUE 1 -# else -# define FMT_USE_OSTREAM_RVALUE 0 -# endif -#endif - // Check if exceptions are disabled. #if defined(__GNUC__) && !defined(__EXCEPTIONS) # define FMT_EXCEPTIONS 0 @@ -2463,8 +2445,6 @@ class SystemError : public internal::RuntimeError { FMT_API void format_system_error(fmt::Writer &out, int error_code, fmt::StringRef message) FMT_NOEXCEPT; -class BasicWriterBase {}; - /** \rst This template provides operations for formatting and writing data into @@ -2484,7 +2464,7 @@ class BasicWriterBase {}; \endrst */ template -class BasicWriter : public BasicWriterBase { +class BasicWriter { private: // Output buffer. Buffer &buffer_; @@ -2929,25 +2909,6 @@ inline BasicWriter &operator<<( } #endif -#if FMT_USE_OSTREAM_RVALUE -// http://cplusplus.github.io/LWG/lwg-active.html#1203 -// -// For: -// std::string s = (MemoryWriter() << "i = " << i).str(); -template < - typename WriterT, - typename T, - typename = typename std::enable_if< - !std::is_lvalue_reference::value - && std::is_base_of::value - >::type -> -inline WriterT &&operator<<(WriterT &&w, const T &value) { - w << value; - return std::move(w); -} -#endif - template template typename BasicWriter::CharPtr BasicWriter::write_str( diff --git a/test/format-test.cc b/test/format-test.cc index e1b22f92..ab37cb44 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -534,10 +534,6 @@ TEST(WriterTest, Stream) { //w << std::wstring(wcs); w << fmt::StrFormatSpec(wcs, 3, ' '); #endif - -#if FMT_USE_OSTREAM_RVALUE - EXPECT_EQ("i = 123", (MemoryWriter() << "i = " << 123).str()); -#endif } TEST(WWriterTest, Stream) { @@ -576,10 +572,6 @@ TEST(WWriterTest, Stream) { EXPECT_EQ(L"ncs", (WMemoryWriter() << fmt::StringRef(ncs)).str()); EXPECT_EQ(L"ncs", (WMemoryWriter() << std::string(ncs)).str()); EXPECT_EQ(L"ncs", (WMemoryWriter() << fmt::StrFormatSpec(ncs, 3, ' ')).str()); - -#if FMT_USE_OSTREAM_RVALUE - EXPECT_EQ(L"i = 123", (WMemoryWriter() << L"i = " << 123).str()); -#endif } TEST(ArrayWriterTest, Ctor) { diff --git a/test/ostream-test.cc b/test/ostream-test.cc index 5e3a7d56..c915ac7b 100644 --- a/test/ostream-test.cc +++ b/test/ostream-test.cc @@ -145,11 +145,6 @@ TEST(OStreamTest, WriteUserDefinedTypeToOStream) { w << "The answer is " << u; fmt::internal::write(os, w); EXPECT_EQ("The answer is 42", os.str()); - -#if FMT_USE_OSTREAM_RVALUE - EXPECT_EQ("The answer is 42", - (fmt::MemoryWriter() << "The answer is " << UserDefinedTest()).str()); -#endif } TEST(OStreamTest, WriteToOStreamMaxSize) {