diff --git a/include/argparse.hpp b/include/argparse.hpp index 701cd0a..d4c3e48 100644 --- a/include/argparse.hpp +++ b/include/argparse.hpp @@ -859,7 +859,7 @@ public: * Used in conjuction with Argument.operator== e.g., parser["foo"] == true * @throws std::logic_error in case of an invalid argument name */ - Argument &operator[](std::string_view aArgumentName) { + Argument &operator[](std::string_view aArgumentName) const { auto tIterator = mArgumentMap.find(aArgumentName); if (tIterator != mArgumentMap.end()) { return *(tIterator->second);