c++11 - I am trying use vlog inside static lamba giving me error: statement-expressions are not allowed outside funstions nor in template-argument lists -


i wrote global static lambda following:

 static auto x = [] (const std::string& y){    vlog(3) <<" y:" <<y;   }; 

it giving me error on vlog statement.:

 statement-expressions not allowed outside functions nor in template-argument lists 

this result of decision made leave room optimizations. relevant bug report here in attempt reopen discussion, , mentions type of use case. compiling without optimizations should work, though know that's lame suggestion. problem lambda being @ global scope, solution brings function should good.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -