Skip to content

Commit

Permalink
Make get(identifier) const
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-stahlberg committed Feb 22, 2024
1 parent c042f82 commit 610498c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/loki/common/pddl/persistent_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ class PersistentFactory {
}

/// @brief Returns a pointer to an existing object with the given identifier.
[[nodiscard]] HolderType const* get(size_t identifier) {
[[nodiscard]] HolderType const* get(size_t identifier) const {
if (identifier < m_persistent_vector.size()) {
return &(m_persistent_vector[identifier]);
}

throw std::runtime_error("invalid identifier");
throw std::invalid_argument("invalid identifier");
}

size_t size() const {
Expand Down

0 comments on commit 610498c

Please sign in to comment.