Hello. Could anyone please explain the following line of code, found on http://docs.openttd.org/ai__cargo_8cpp_source.html
return (AICargo::TownEffect)::CargoSpec::Get(cargo_type)->town_effect;
If this line was:
return (AICargo::TownEffect) ::CargoSpec::Get(cargo_type)->town_effect;
(note the space between TownEffect)
and the ::
) then I would understand it fine. However there is no whitespace in that document*, which would mean (AICargo::TownEffect)
is the left operand of the :: operator.
How does this code work/compile? Or are the two things equivilent due to some obscure C++ rule?
*It's the same in the cpp file as well.