Const function

Gilles G. schaouette at free.fr
Wed Nov 28 23:16:40 PST 2007


(... start a new thread because I just don't know who to reply to)

Many posts about const/invariant talk about the "problem" of defining const functions. Some think we should indicate constness at the end of the function declaration, but it is also possible to do it at the front.
So, as far as I understand it, there are two ways to express function constness for now:
   const int foo();
   int foo() const;
To my mind, both solutions are unintuitive. I would expect something like that:
   int const foo();
Is there any big argument against this?




More information about the Digitalmars-d mailing list