Re: [lambda] Segmentation fault in simple lambda program

2009-04-30 Thread Esben Mose Hansen
On Thursday 30 April 2009 19:19:31 you wrote: > When I try to specify the capture it works ((&sum, &f) works too but f is > const): > > #include > > int > main(void) > { > int numbers[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; > const std::size_t nn = sizeof(numbers)/sizeof(int); > int sum = 0; >

[lambda] Segmentation fault in simple lambda program

2009-04-29 Thread Esben Mose Hansen
Hi, this program SEGFAULTs #include int main() { int numbers[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; const std::size_t nn = sizeof(numbers)/sizeof(int); int sum = 0; int f = 5; std::for_each(&numbers[0], &numbers[nn], [&] (int n) { sum += n * f; }); } Now, my assembly days are

Re: gcc-in-cxx update / multi-targeted gcc

2009-04-29 Thread Esben Mose Hansen
On Wednesday 29 April 2009 12:47:04 Joern Rennecke wrote: > Something which I miss in C++ is a way to declare that a function uses > an integral type to pass an enum value (in arguments or return value), > and then at function definition time only check that the integral type > is sufficently large

The C++0x lambda branch

2009-04-27 Thread Esben Mose Hansen
Hi, I have very much been looking forward to the including of the lambda part of C++0x. I have been playing around with the lambda branch of gcc, which at least superficially works well apart from assorted bugs. What can I do to make lambdas part of a future release of gcc? Where do I report/