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

Initialized Lambda Capture

Dix_Lorenz
Beginner
376 Views

According to https://software.intel.com/en-us/articles/c14-features-supported-by-intel-c-compiler ICC15 should support initialized lambda captures. Yet code like this

 

 

 

 

*this = make([f, theLocalData = std::move(theLocalData)] {

fails to compile:

error: expected a "]"

1>        *this = make([f, theLocalData = std::move(theLocalData)] {

1>                                      ^

 

clang compiles it, so I assume I am using that feature correctly: I didn't find any compiler option to enable C++14, it is set to use C++11 features though. Bug in the compiler or am I using it wrong?

 

(Sorry for the formatting, but this editor is totally messed up on Safari)

0 Kudos
2 Replies
Judith_W_Intel
Employee
376 Views

 

Could you please provide a complete test case? Also please try the -std=c++14 option.

thanks,

Judy

0 Kudos
Dix_Lorenz
Beginner
376 Views

how would I set -std=c++14 in Visual Studio? The property editor only offers to enable C++11 support.

0 Kudos
Reply