Discover more from Daily bit(e) of C++
Daily bit(e) of C++ | <iosfwd>
Daily bit(e) of C++ #260, The <iosfwd> header.
Including the <iostream> header can significantly impact compile time, as it is one of the heavy standard C++ headers.
As an alternative, notably for library headers, the <iosfwd> header provides only forward declaration, making it essentially free.
As long as we only need to declare stream insertion and extraction functions, the <iosfwd> header is sufficient.
Thanks for reading Daily bit(e) of C++! Subscribe for free to receive new posts and support my work.