sabriallani / ticpp

Automatically exported from code.google.com/p/ticpp
0 stars 0 forks source link

Broken iterator usage example in TiXml++ tutorial #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
in "Use STL style iterators to move through nodes and attributes":

// Only iterates through Element nodes
ticpp::Iterator< ticpp::Element > child;
for ( child = parent->FirstChild(); child != child.end(); child++ )

but it should be 

// Only iterates through Element nodes
ticpp::Iterator< ticpp::Element > child;
for ( child = parent->FirstChildElement(); child != child.end(); child++ )

Comments iterator example may also be broken.

P.S. Windows XP SP2, MSVC 2003 SP1

Original issue reported on code.google.com by gregory....@gmail.com on 27 Feb 2007 at 6:02

GoogleCodeExporter commented 8 years ago
I added a new way to start iteration.

// Only iterates through Element nodes
ticpp::Iterator< ticpp::Element > child;
for ( child = child.begin( parent ); child != child.end(); child++ )

This syntax works property for all iterations. I also updated the documentation.

Original comment by rjmy...@gmail.com on 1 Oct 2007 at 2:38