clang 3.1(trunk) に Lambda expressions と Extending sizeof が実装された
ヒャッハー!
[ソース]
#include <cassert> #include <algorithm> #include <iostream> struct X{ int value; }; int main(){ // Lambda expressions int v[] = { 1, 2, 3, 4, 5 }; int sum = 0; std::for_each(v, v+5, [&](int n){ std::cout << n << ", "; sum += n; }); std::cout << sum << std::endl; // Extending sizeof int size = sizeof(X::value); std::cout << size << std::endl; int size2 = sizeof(X::value + 2LL); std::cout << size2 << std::endl; return 0; }