In "C++ Primer", exercise 14.47, there is a question:
Explain the difference between these two conversion operators:
struct Integral { operator const int(); operator int() const; }
I don't know why the the answer I found on GitHub says that the first const
is meaningless, because for one conversion operator should not define return type, this const
here is unspecified, it will be ignored by the compiler. But I also found some guys say that it means the function will return a const
value.
So, I wonder which one is correct, and why?