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. 
 
std::istringstream is
The input stream: the specification to translate. 
 
std::istream & operator>>(std::istream &is, direction &d)
Parsing.