diff --git a/Foundation/include/Poco/Dynamic/Struct.h b/Foundation/include/Poco/Dynamic/Struct.h index 1f948d647..ebd6a5f47 100644 --- a/Foundation/include/Poco/Dynamic/Struct.h +++ b/Foundation/include/Poco/Dynamic/Struct.h @@ -530,12 +530,12 @@ public: return false; } - Var& operator [] (std::size_t name) + Var& operator [] (int name) { return _val[name]; } - const Var& operator [] (std::size_t name) const + const Var& operator [] (int name) const { return _val[name]; } diff --git a/Foundation/include/Poco/Dynamic/Var.h b/Foundation/include/Poco/Dynamic/Var.h index 290df9076..078cb74e7 100644 --- a/Foundation/include/Poco/Dynamic/Var.h +++ b/Foundation/include/Poco/Dynamic/Var.h @@ -436,7 +436,7 @@ public: InvalidAccessException>("Not an array.")->operator[](n); else if (isStruct()) return structIndexOperator(holderImpl, - InvalidAccessException>("Not a struct."), n); + InvalidAccessException>("Not a struct."), static_cast(n)); else throw InvalidAccessException("Must be struct or array."); } @@ -451,7 +451,7 @@ public: InvalidAccessException>("Not an array.")->operator[](n); else if (isStruct()) return structIndexOperator(holderImpl, - InvalidAccessException>("Not a struct."), n); + InvalidAccessException>("Not a struct."), static_cast(n)); else throw InvalidAccessException("Must be struct or array."); }