diff --git a/CPP20.md b/CPP20.md index 97cc9a2..032ae80 100644 --- a/CPP20.md +++ b/CPP20.md @@ -19,6 +19,7 @@ C++20 includes the following new language features: C++20 includes the following new library features: - [concepts library](#concepts-library) +- [synchronized buffered outputstream](#synchronized-buffered-outputstream) ## C++20 Language Features @@ -364,6 +365,12 @@ Concepts are also provided by the standard library for building more complicated See also: [concepts](#concepts). +### synchronized buffered outputstream +Buffers output operations for the wrapped output stream ensuring synchronization (i.e. no interleaving of output). +```c++ +std::osyncstream{std::cout} << "The value of x is:" << x << std::endl; +``` + ## Acknowledgements * [cppreference](http://en.cppreference.com/w/cpp) - especially useful for finding examples and documentation of new library features. * [C++ Rvalue References Explained](http://thbecker.net/articles/rvalue_references/section_01.html) - a great introduction I used to understand rvalue references, perfect forwarding, and move semantics. diff --git a/README.md b/README.md index 10f8a83..2134639 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ C++20 includes the following new language features: C++20 includes the following new library features: - [concepts library](#concepts-library) +- [synchronized buffered outputstream](#synchronized-buffered-outputstream) C++17 includes the following new language features: - [template argument deduction for class templates](#template-argument-deduction-for-class-templates) @@ -456,6 +457,12 @@ Concepts are also provided by the standard library for building more complicated See also: [concepts](#concepts). +### synchronized buffered outputstream +Buffers output operations for the wrapped output stream ensuring synchronization (i.e. no interleaving of output). +```c++ +std::osyncstream{std::cout} << "The value of x is:" << x << std::endl; +``` + ## C++17 Language Features ### Template argument deduction for class templates