C++ const functions and GCC const tttribute

http://gcc.gnu.org/onlinedocs/gcc-3.1.1/gcc/Function-Attributes.html

There's this sentence at the end of the explanation of the const attribute :

"This approach does not work in GNU C++ from 2.6.0 on, since the language specifies that the const must be attached to the return value. "

What does it mean? Is there a standard way in C++ to declare functions as const like the const attribute does? And anyway, what does that sentense mean?
What they probably mean is that when you write const int func(int x), the language dictates that the const refers to the return type (int). In order to conform to this, they could no longer assign const an alternate meaning.
Topic archived. No new replies allowed.