Opened 18 years ago

Closed 17 years ago

#363 closed Patches (Accepted)

Perl style foreach iterating

Reported by: genjix Owned by: Eric Niebler
Milestone: Component: None
Version: None Severity:
Keywords: Cc:

Description

somewhere in boost, there should be a perl style foreach iterator,  
like so  
#define ITERATOR(obj)	typeof(obj.begin())  
#define foreach(v,i)	for(ITERATOR(v) i = v.begin() ; i !=  
v.end() ; i++)  
  
genjix at gmail.com 

Change History (2)

comment:1 by dprotti, 17 years ago

Logged In: YES 
user_id=1012656

There is something like that. In fact, there is something
much better, take a look at this article:

http://www.informit.com/articles/article.asp?p=400651

About your submission, it's not a patch, is more like a
feature request, so this is not the correct place to post it.


Regards,
Duilio Protti.

comment:2 by Eric Niebler, 17 years ago

Status: assignedclosed
Logged In: YES 
user_id=905418

It's called BOOST_FOREACH, and it's already in Boost CVS.
It'll be part of 1.34 when it comes out, but you can get it
today from the Boost File Vault at
http://boost-consulting.com/vault/index.php?&directory=Algorithms

Note: See TracTickets for help on using tickets.