new foreach macro

Everything related to the code /
Tout ce qui touche au code
Post Reply
User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

new foreach macro

Post by zuzuf » Sat Apr 26, 2008 2:22 pm

I've added a new macro called 'foreach' you can use that way:
std::list/std::vector/std::* lst;

Code: Select all

foreach( lst, i )
 { /* do what you want with i = current element of lst */ }
it uses the GCC special keyword typeof which is specific to GCC, so we'll have to write a specific version of this macro for each compiler we want to support. I think for msvc you can use something like ::typeid but I am not sure.

This macro is in the stdafx.h file
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests