From 72ba6a80ae15683c27c8f6bd63d6e1239b9b38cf Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Mon, 3 Feb 2025 15:35:03 +0100 Subject: [PATCH] made types behave --- cpp/src/coords.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/src/coords.hpp b/cpp/src/coords.hpp index a18d51d..44dc8d3 100644 --- a/cpp/src/coords.hpp +++ b/cpp/src/coords.hpp @@ -29,17 +29,17 @@ struct Coords { "An algebraic coordinate should only have two characters" ); - int x = _FILES.find(pos[0]); + size_t x = _FILES.find(pos[0]); if (x == std::string::npos) throw std::invalid_argument("The first character of the given " "algebraic coordinate is invalid"); - int y = _RANKS.find(pos[1]); + size_t y = _RANKS.find(pos[1]); if (y == std::string::npos) throw std::invalid_argument("The second character of the given " "algebraic coordinate is invalid"); - return Coords{x, y}; + return Coords{(int) x, (int) y}; } std::string to_algebraic() const {