View Full Version : Iterating Through Containers in C++, with Some Help from Boost's Lambda Library
07-31-2005, 08:21 PM
Don't be jealous of programmers using new languages, such as Python or C#! C++ gives you many ways to iterate through data you've stored in containers, supports for-each, and has helpful devices called lambda functions. Jeff Cogswell shows you how you can fly through your containers with ease.
Link Here (http://www.informit.com/articles/article.asp?p=400651&rl=1)
Original source : Utilitybase.com
11-29-2005, 04:23 AM
List iteration is just one of those things you can never avoid having to do in the real world. Luckily, amigaos linked lists are more than enough for amiga only coding in C.
The rest of the the time in C++ etc, in my experience you end up with containers full of pointers rather than containers full of actual objects. In C++ an ideal solution is to make base classes (or specialise an STL one) that handles void* in an optimal way and inherit it in a type safe template that adds no extra code. Less bloat, more performance, no sacrifice in compatibility (if using the STL interface anyway).
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.