mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user