Jianli Shen wrote:
in a *.h file, there is a declaration:
const ClassName *functionName() const {return oneVar;}
Look at each part separately -- the "stuff" before the name of the
function is (mostly) the return type, while what comes after the name
refers to the function itself.
const ClassName *
That much is talking about the function's return value -- it returns a
pointer to a const ClassName.
function() const
That means the function itself is const -- i.e. that it's a member of a
class, and when it's invoked, 'this' points to a const X (X=whatever
its class type is).
--
Later,
Jerry.
The universe is a figment of its own imagination.