From f92e9dcac70dc0859e1cf176b84b39c42f677e3e Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sat, 9 Jan 2016 02:42:11 -0800 Subject: [PATCH] successors is const --- sliding_tile_lib.cc | 2 +- sliding_tile_lib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sliding_tile_lib.cc b/sliding_tile_lib.cc index e4f2f12..5284dab 100644 --- a/sliding_tile_lib.cc +++ b/sliding_tile_lib.cc @@ -133,7 +133,7 @@ int Board::distance(const InvertedBoard& invo) const { return dist; } -std::vector Step::successors(std::shared_ptr shared_this) { +std::vector Step::successors(std::shared_ptr shared_this) const { std::vector suc; signed char hole_pos = board.hole(); for (int i = 0; adjacent[hole_pos][i] > 0; i++) { diff --git a/sliding_tile_lib.h b/sliding_tile_lib.h index 772817e..1b56da4 100644 --- a/sliding_tile_lib.h +++ b/sliding_tile_lib.h @@ -30,7 +30,7 @@ std::ostream& operator<<(std::ostream& os, const Board& board); struct Step { Board board; std::shared_ptr prev; - std::vector successors(std::shared_ptr shared_this); + std::vector successors(std::shared_ptr shared_this) const; static signed char adjacent[BOARD_SIZE][5]; }; std::ostream& operator<<(std::ostream& os, const Step& step); -- 2.44.1