Skip to content

Iterating over Var containing empty container throws "Out of range" exception #2945

@akete

Description

@akete

When iterating over Poco::Dynamic::Var that contains empty continer (e. g. Poco::Dynamic::Vector), iteration loop is entered and "Out of range" exception is thrown when dereferencing VarIterator.

Poco::Dynamic::Var v{Poco::Dynamic::Vector()};
int i = 0;
for (auto it = v.begin(); it != v.end(); ++it) {
    *it = ++i;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions