Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Lambdas not working

Nav
New Contributor I
370 Views
I had posted this in the TBB forum and they recommended that I post it here.

This is my question:
http://software.intel.com/en-us/forums/showthread.php?t=71088page/1/#106781

Any pointers in the right direction would be appreciated.
0 Kudos
5 Replies
Dale_S_Intel
Employee
370 Views
Quoting - Nav
I had posted this in the TBB forum and they recommended that I post it here.

This is my question:
http://software.intel.com/en-us/forums/showthread.php?t=71088page/1/#106781

Any pointers in the right direction would be appreciated.

Well, this is the Intel C++ Compiler forum, and your question seems to be how do you get lambda's working. It seems to work fine with the switch mentioned in the other thread, "-std=c++0x":

[cpp]$ icc -c lambda1.cpp 
lambda1.cpp(43): error: expected an expression
  [&](){ par_ms(beg, mid, A); }, 
  ^

lambda1.cpp(44): error: expected an expression
  [&](){ par_ms(mid, end, A); } 
  ^

compilation aborted for lambda1.cpp (code 2)
$ icc -std=c++0x -c lambda1.cpp 
$ 
[/cpp]
That was with the 11.1 compiler.

Dale
0 Kudos
Nav
New Contributor I
370 Views
That was with the 11.1 compiler.

I agree that it will work with the Intel compiler. I'm working with gcc.
A person who replied to the other thread said that lambda's will be supported only from gcc 4.5 onward (which isn't available for download as yet).
Is that true?
0 Kudos
Nav
New Contributor I
370 Views
0 Kudos
TimP
Honored Contributor III
370 Views
I don't know where you're going with it, but gcc 4.5 source and pre-built versions are available. It's a pre-release; I think gcc-4.4.3 is the most recent release. For example, gfortran wiki has gfortran and g++ builds for several of the usual platforms.
0 Kudos
Nav
New Contributor I
370 Views
Could you point me to any links where I could download it from?
0 Kudos
Reply