Prefer operator<<() to pretty()

It is more idiomatic, we didn't used it
in the past because Position::pretty(Move)
had a calling argument, but now we can.

As an added benefit, we avoid a lot of string
copies in the process because now we avoid
std::ostringstream ss.

No functional change.
This commit is contained in:
Marco Costalba
2014-11-01 18:50:27 +01:00
parent d07a875398
commit 5644e14d0e
3 changed files with 29 additions and 29 deletions

View File

@@ -73,6 +73,9 @@ const size_t StateCopySize64 = offsetof(StateInfo, key) / sizeof(uint64_t) + 1;
/// when traversing the search tree.
class Position {
friend std::ostream& operator<<(std::ostream&, const Position&);
public:
Position() {}
Position(const Position& pos, Thread* t) { *this = pos; thisThread = t; }
@@ -80,10 +83,9 @@ public:
Position& operator=(const Position&);
static void init();
// Text input/output
// FEN string input/output
void set(const std::string& fenStr, bool isChess960, Thread* th);
const std::string fen() const;
const std::string pretty() const;
// Position representation
Bitboard pieces() const;