c++ - C++0x issue on ICC compilation -


for each (auto obs in observers)      *obs = true; 

i have problem compiling icc.

error : cannot deduce "auto" type (initializer required)

please solve above issue. thanks.

this syntax not valid in c++. try instead:

for (auto obs_iter=observers.begin(); obs_iter != observers.end(); ++obs_iter)     **obs_iter = true; 

(this assumes observers store pointers objects)

if compiler supports range-based loops, can following:

for (auto &obs: observers)     *obs = true; 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -