C++ in the kernel

Marcin Wisnicki mwisnicki+freebsd at gmail.com
Thu Nov 1 01:05:28 PDT 2007


On Tue, 30 Oct 2007 23:19:50 +0100, Ivan Voras wrote:
> Re: C++: This:
> 
> for (vector<int>::iterator it = v.begin(); it != v.end(); ++it)
> 
> still looks pretty ugly but at least it's known to almost any CS/IT
> undergrad out there.
> 
> My personal choice of a "C++ done right" language is D, it has this
> variant:
> 
> foreach(i, a; args)
>     writefln("args[%d] = '%s'", i, a);

You can do something like that in c++, for example with boost::foreach:

#include <boost/foreach.hpp>
#define foreach BOOST_FOREACH

foreach(int i, v) {
}



More information about the freebsd-arch mailing list