diff --git a/src/movegen.cpp b/src/movegen.cpp index eed551e0a..c3be5e001 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -48,20 +48,6 @@ void movelist_buf::mlb_shutdown() } } -template -MoveList::MoveList(const Position& pos) -{ - this->mlb = get_thread_mlb(pos); - this->moveList = this->mlb->acquire(); - this->last = generate(pos, this->moveList); -} - -template -MoveList::~MoveList() -{ - this->mlb->release(this->moveList); -} - namespace { template @@ -541,12 +527,6 @@ template ExtMove* generate(const Position&, ExtMove*); template ExtMove* generate(const Position&, ExtMove*); template ExtMove* generate(const Position&, ExtMove*); template ExtMove* generate(const Position&, ExtMove*); -template struct MoveList; -template struct MoveList; -template struct MoveList; -template struct MoveList; -template struct MoveList; -template struct MoveList; /// generate generates all the legal moves in the given position diff --git a/src/movegen.h b/src/movegen.h index 8990cf1a0..a92c423ac 100644 --- a/src/movegen.h +++ b/src/movegen.h @@ -28,6 +28,8 @@ namespace Stockfish { class Position; class movelist_buf; +movelist_buf* get_thread_mlb( const Position& pos ); + enum GenType { CAPTURES, QUIETS, @@ -144,8 +146,18 @@ ExtMove* generate(const Position& pos, ExtMove* moveList); template struct MoveList { - explicit MoveList(const Position& pos); - ~MoveList(); + explicit MoveList(const Position& pos) + { + this->mlb = get_thread_mlb(pos); + this->moveList = this->mlb->acquire(); + this->last = generate(pos, this->moveList); + } + + ~MoveList() + { + this->mlb->release(this->moveList); + } + const ExtMove* begin() const { return moveList; } const ExtMove* end() const { return last; } size_t size() const { return last - moveList; } @@ -159,7 +171,6 @@ struct MoveList { ExtMove* moveList = nullptr; }; -movelist_buf* get_thread_mlb( const Position& pos ); } // namespace Stockfish