gcc/libstdc++-v3/testsuite/27_io
Jonathan Wakely ecba8547dd libstdc++: Implement std::emit_on_flush etc.
This adds the manipulators for use with basic_osyncstream. In order to
detect when an arbitrary basic_ostream<C,T> is the base class of a
basic_syncbuf<C,T,A> object, introduce a new intermediate base class
that stores the data members. The new base class stores a pointer and
two bools, which wastes (sizeof(void*) - 2) bytes of padding. It would
be possible to use the two least significant bits of the pointer for the
two bools, at least for targets where alignof(basic_streambuf) > 2, but
that's left as a possible change for a future date.

Also define basic_syncbuf::overflow to override the virtual function in
the base class, so that single characters can be inserted into the
stream buffer. Previously the default basic_streambuf::overflow
implementation was used, which drops the character on the floor.

libstdc++-v3/ChangeLog:

	* include/std/ostream (__syncbuf_base): New class template.
	(emit_on_flush, noemit_on_flush, flush_emit): New manipulators.
	* include/std/syncstream (basic_syncbuf): Derive from
	__syncbuf_base instead of basic_streambuf.
	(basic_syncbuf::operator=): Remove self-assignment check.
	(basic_syncbuf::swap): Remove self-swap check.
	(basic_syncbuf::emit): Do not skip pubsync() call if sequence
	is empty.
	(basic_syncbuf::sync): Remove no-op pubsync on stringbuf.
	(basic_syncbuf::overflow): Define override.
	* testsuite/27_io/basic_syncstream/basic_ops/1.cc: Test
	basic_osyncstream::put(char_type).
	* testsuite/27_io/basic_ostream/emit/1.cc: New test.
2020-11-11 00:19:40 +00:00
..
basic_filebuf
basic_fstream libstdc++: Enable tests that incorrectly require cxx11-abi 2020-10-14 12:52:46 +01:00
basic_ifstream
basic_ios
basic_iostream
basic_istream libstdc++: Do not set eofbit eagerly in operator>>(istream&, char(&)[N]) 2020-08-06 19:23:14 +01:00
basic_istringstream libstdc++: Add remaining C++20 additions to <sstream> [P0408R7] 2020-11-10 19:22:47 +00:00
basic_ofstream
basic_ostream libstdc++: Implement std::emit_on_flush etc. 2020-11-11 00:19:40 +00:00
basic_ostringstream libstdc++: Add remaining C++20 additions to <sstream> [P0408R7] 2020-11-10 19:22:47 +00:00
basic_streambuf
basic_stringbuf libstdc++: Add remaining C++20 additions to <sstream> [P0408R7] 2020-11-10 19:22:47 +00:00
basic_stringstream libstdc++: Add remaining C++20 additions to <sstream> [P0408R7] 2020-11-10 19:22:47 +00:00
basic_syncbuf libstdc++: Add c++2a <syncstream> 2020-11-02 10:41:32 -08:00
basic_syncstream libstdc++: Implement std::emit_on_flush etc. 2020-11-11 00:19:40 +00:00
filesystem libstdc++: Avoid warnings in tests 2020-10-29 22:47:21 +00:00
fpos
headers
ios_base libstdc++: Add C++11 member functions for ios::failure in old ABI 2020-10-08 14:45:37 +01:00
manipulators
objects
types libstdc++: Add deprecated attributes to old iostream members 2020-08-19 12:13:23 +01:00
rvalue_streams-2.cc
rvalue_streams.cc