Add an overload of print that accepts std::ostream.