diff --git a/include/kvpp/kvpp.h b/include/kvpp/kvpp.h index 4639238dd..33d258a6f 100644 --- a/include/kvpp/kvpp.h +++ b/include/kvpp/kvpp.h @@ -53,7 +53,7 @@ class KV1Element { [[nodiscard]] const std::vector& getChildren() const; /// Get the child element of the element at the given index - [[nodiscard]] const KV1Element& operator[](std::size_t index) const; + [[nodiscard]] const KV1Element& operator[](unsigned int n) const; /// Get the first child element of the element with the given key [[nodiscard]] const KV1Element& operator[](std::string_view childKey) const; diff --git a/src/kvpp/kvpp.cpp b/src/kvpp/kvpp.cpp index 8c0657810..3195080c2 100644 --- a/src/kvpp/kvpp.cpp +++ b/src/kvpp/kvpp.cpp @@ -41,8 +41,8 @@ const std::vector& KV1Element::getChildren() const { return this->children; } -const KV1Element& KV1Element::operator[](std::size_t index) const { - return this->children.at(index); +const KV1Element& KV1Element::operator[](unsigned int n) const { + return this->children.at(n); } const KV1Element& KV1Element::operator[](std::string_view childKey) const {