On Nov 12, 6:13 am, "Alf P. Steinbach" <al...@start.nowrote:
* Kibiz0r:
On Nov 11, 10:53 pm, "subramanian10...@yahoo.com, India"
<subramanian10...@yahoo.comwrote:
why can't a static member function be declared as const ?
Because it wouldn't make any sense.
This is a common misconception where any missing language feature is
discussed.
Wouldn't it be more accurate to say that the statement doesn't
have any real meaning. It's an almost meaningless phrases used
to lead into the real argument. If it's not followed up by
further argument, it's vacuous. If it is, it means whatever the
further argument says it means.
In this case, the poster was quite clear: allowing the keyword
const behind a static function makes no sense with regards to
the current semantics associated with const applied to a
function. Obviously, if you want to propose other semantics,
then someone opposing them would have to offer other arguments.
E.g., it's also often offered as a purported explanation for
the lack of 'virtual static' member function and for the lack
of 'virtual' constructors.
And for just about everything. That's a frequent case for more
or less vacuous lead-ins. They're just rhetoric (not
necessarily in the bad sense).
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34