Summary
In this chapter, we learned about I/O operations in C++. We considered the I/O Standard Library, which provides an interface for synchronous I/O operations. Also, we considered platform-dependent native tools for asynchronous I/O, and the Boost.Asio library for cross-platform asynchronous I/O operations. We also learned how to use I/O streams in multithreaded applications.
We started by looking at the basic features that the Standard Library provides for I/O operations. We learned about predefined stream objects such as std::cin and std::cout. In practice, we learned how to work with standard streams and override shift operators for easy read and write custom data types.
Next, we practiced how to create additional streams. We inherited from the basic stream class, implemented our own stream buffer class, and practiced their usage in the exercises. We learned about the most appropriate stream classes for inheritance and considered their pros and cons.
Then, we considered the approaches...