From b4efc5a245ebb0199347541f39a452b8c1eefd22 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 24 Nov 2023 20:13:28 +0100 Subject: [PATCH] const --- includes/Piece.hpp | 4 ++-- src/Piece.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/Piece.hpp b/includes/Piece.hpp index fe5a877..21a8c04 100644 --- a/includes/Piece.hpp +++ b/includes/Piece.hpp @@ -10,8 +10,8 @@ class Piece { std::string categorie; public: - Piece(std::string categorie); // constructor - virtual ~Piece(); // destructor + Piece(const std::string categorie); // constructor + virtual ~Piece(); // destructor Piece(const Piece &); // copy constructor const Piece &operator=(const Piece &); // copy assignement diff --git a/src/Piece.cpp b/src/Piece.cpp index 72b3eb0..2b35759 100644 --- a/src/Piece.cpp +++ b/src/Piece.cpp @@ -1,6 +1,6 @@ #include "../includes/Piece.hpp" -Piece::Piece(std::string cat) { std::cout << "pièce\n"; } +Piece::Piece(const std::string cat) { std::cout << "pièce - " << cat << "\n"; } Piece::~Piece() {}