Suppose your code is in a header file somewhere.
As it happens, Thing
also has an operator(), and it is stored in a std::function
in two different cpp files.
Someone gets the typeids out of the two std::function
s and asks if they are equal.
With external linkage on the float, they are clearly the same type. Without, there is no way to express they are.
Basically, the type is dependent on the identity not the value of the float, and only extern linkage globals have identity at the same "level" as the standard wants such types to have.
Now the same can be said of lambdas, but lambdas lead to ODR violations extremely often.