operator overloading - cppreference.com
Scroll down to "Stream extraction and insertion"