$ icpc test.cpp
test.cpp(22): error: expected an expression
for_each(idx.begin(), idx.end(), [&m_vec](int x) { cout << m_vec
^
compilation aborted for test.cpp (code 2)
The [&m_vec] should be [this]. It seems like there is compatibility issues between ICC/GNU GCC on this. The standard seems to say [this] is correct. Perhaps this issue could be resolved to make ICC compatible with GCC?
Thanks.
Link Copied
For more complete information about compiler optimizations, see our Optimization Notice.