You must add const in return type. Like this: const float GetVal()const {return val;} Because the type of val had been upgraded into "const float" in the GetVal function.
Y
yang763876248
@yang763876248
You must add const in return type. Like this: const float GetVal()const {return val;} Because the type of val had been upgraded into "const float" in the GetVal function.