forked from boostorg/beast
New ostream() returns dynamic buffer output stream (API Change):
This eliminates beast::write output for dynamic buffers and replaces it with the function ostream() that wraps a caller provided dynamic buffer and returns the result as a std::ostream derived object. Callers may now produce formatted output into any object meeting the requirements of DynamicBuffer using operator<< and the standard stream modifiers such as std::endl. This new technique is more efficient, as implementations of operator<< can now write directly into the output using std::ostream::write and std::ostream::put. Example of use: beast::streambuf sb; beast::ostream(sb) << "Hello, world!" << std::endl;
This commit is contained in:
@@ -273,13 +273,6 @@ public:
|
||||
BEAST_EXPECT(test::buffer_count(sb.data()) == 4);
|
||||
}
|
||||
|
||||
void testOutputStream()
|
||||
{
|
||||
streambuf sb;
|
||||
sb << "x";
|
||||
BEAST_EXPECT(to_string(sb.data()) == "x");
|
||||
}
|
||||
|
||||
void testCapacity()
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
@@ -353,7 +346,6 @@ public:
|
||||
testConsume();
|
||||
testMatrix();
|
||||
testIterators();
|
||||
testOutputStream();
|
||||
testCapacity();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user