c++ - What does "error: cannot use type 'void' as a range" actually mean? -
when compile in clang 3.2
for(auto x : {1, 1.2}){}
i error this:
error: cannot use type 'void' range
what mean?
you mixed types in initializer list. in case can pretty clear, don't forget
std::string foo; for(auto x : {foo, "bar"}){}
are 2 separate types. there of course plenty of other cases may expect work, types have match exactly.
Comments
Post a Comment