Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Iterator problems in for loop #63

@GoogleCodeExporter

Description

@GoogleCodeExporter
This code works like it should (from the beginner example):
ticpp::Iterator<ticpp::Element> child;
for(child = child.begin(doc.FirstChildElement()); child != child.end(); child++)
or
ticpp::Iterator<ticpp::Element> child;
for(child = child.begin(doc.FirstChildElement()); child != child.end(); ++child)

Now I get SIGSEGV when I want to do it like this:
for(ticpp::Iterator<ticpp::Element> child = 
child.begin(doc.FirstChildElement()); child != child.end(); child++)

Loop ends immediately when I change the iteration:
for(ticpp::Iterator<ticpp::Element> child = 
child.begin(doc.FirstChildElement()); child != child.end(); ++child)

I'm using Code::Blocks on Windows. Although it can be worked around it still is 
quite annoying when you are used to the STL iterators (like in the last 
example).

Original issue reported on code.google.com by simmo.s...@gmail.com on 17 Feb 2011 at 4:31

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions