C++ in the kernel
Marcin Wisnicki
mwisnicki+freebsd at gmail.com
Wed Oct 31 12:05:31 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 this 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