+ // When formatting a move for std::cout we must know if we are in Chess960
+ // or not. To keep using the handy operator<<() on the move the trick is to
+ // embed this flag in the stream itself. Function-like named enum set960 is
+ // used as a custom manipulator and the stream internal general-purpose array,
+ // accessed through ios_base::iword(), is used to pass the flag to the move's
+ // operator<<() that will use it to properly format castling moves.
+ enum set960 {};
+
+ std::ostream& operator<< (std::ostream& os, const set960& m) {
+
+ os.iword(0) = int(m);
+ return os;
+ }
+
+