]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
More idiomatic signature for operator=()
[stockfish] / src / position.cpp
index 4be0a231d5ef4226c6b4b6d3abce68b3697c363d..a425b59cc80a83520a50b7e6f9a32ec335e72a55 100644 (file)
@@ -89,7 +89,7 @@ CheckInfo::CheckInfo(const Position& pos) {
 /// object do not depend on any external data so we detach state pointer from
 /// the source one.
 
-void Position::operator=(const Position& pos) {
+Position& Position::operator=(const Position& pos) {
 
   memcpy(this, &pos, sizeof(Position));
   startState = *st;
@@ -97,6 +97,8 @@ void Position::operator=(const Position& pos) {
   nodes = 0;
 
   assert(pos_is_ok());
+
+  return *this;
 }