From b8c521be31568808eba3f93409f18eca34cfeaca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Fri, 1 Dec 2023 14:17:12 +0100 Subject: [PATCH] Mark SymbolTable::maxID() as const and nodiscard --- src/SymbolTable.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SymbolTable.hh b/src/SymbolTable.hh index dfa72905..f381db60 100644 --- a/src/SymbolTable.hh +++ b/src/SymbolTable.hh @@ -363,7 +363,7 @@ public: //! Get number of parameters [[nodiscard]] inline int param_nbr() const noexcept(false); //! Returns the greatest symbol ID (the smallest is zero) - inline int maxID(); + [[nodiscard]] inline int maxID() const; //! Get number of user-declared endogenous variables (without the auxiliary variables) [[nodiscard]] inline int orig_endo_nbr() const noexcept(false); //! Write output of this class @@ -540,7 +540,7 @@ SymbolTable::param_nbr() const noexcept(false) } inline int -SymbolTable::maxID() +SymbolTable::maxID() const { return symbol_table.size() - 1; }