std::istream & operator>>(std::istream &is, direction &d)
Parsing.
std::ostream & operator<<(std::ostream &os, direction d)
Pretty-printing.
std::ostringstream os
The output stream: the corresponding C++ snippet to compile.
std::string to_string(direction d)
Conversion to string.