c++ - error C2143: syntax error : missing ',' before ':' -
i'm trying build opensource game keep getting error when trying build. have been searching last half hour nothing working here's code errors pointing to
void duel::restore_assumes() { for(auto pcard : assumes) pcard->assume_type = 0; assumes.clear(); }
and error is
error 1 error c2143: syntax error : missing ',' before ':' c:\users\user\desktop\project source\ocgcore\duel.cpp 108 1 ocgcore (visual studio 2010)
ms vc++ 2010 not support range based statement introduced in c++ 2011. has own language extension: for each
.
try change code
void duel::restore_assumes() { for(auto pcard : assumes) pcard->assume_type = 0; assumes.clear(); }
to
void duel::restore_assumes() { each (auto pcard in assumes) pcard->assume_type = 0; assumes.clear(); }
otherwise can use ordinary loop iterators of object assumes or standard algorithm example std::for_each
Comments
Post a Comment