# **[](https://en.cppreference.com/w/cpp/header/iosfwd)** provides forward declarations of stream classes without including the full implementation. Use it in header files when you want to accept a stream parameter or return type without pulling in the heavy iostream headers. It's a small optimization to reduce compile times. ## Example This example declares a function that takes an ostream parameter using only forward declarations, avoiding the overhead of including iostream. ```cpp // compile: g++ -std=c++11 -o iosfwdexample iosfwdexample.cpp // run: ./iosfwdexample // description: forward declaration of ostream in a header #include #include void print_message(std::ostream& out); void print_message(std::ostream& out) { out << "hello from iosfwd\n"; } int main() { print_message(std::cout); return 0; } ```