Page 1 of 1

StringConverter::toString [const]

Posted: Sat Dec 27, 2008 2:10 pm
by TWO
Is there a reason for StringConverter::toString methods not beeing const?

Re: StringConverter::toString [const]

Posted: Sat Dec 27, 2008 2:16 pm
by jacmoe
The member functions are static and the parameter is const. Why would you want them to return consts?
It's just a utility class. :)

Re: StringConverter::toString [const]

Posted: Sat Dec 27, 2008 2:31 pm
by darke
Or are you asking something like:

Code: Select all

static String Ogre::StringConverter::toString( ... ) [b]const[/b] { ... }
There's no point to this since there's no class member variables for toString to modify, even if it could, it's still static. (And I'm not even sure if it's syntactically valid according to the standard too?)

Re: StringConverter::toString [const]

Posted: Sat Dec 27, 2008 2:41 pm
by Kojack
You can't make a static methods const. It's not valid c++.

Re: StringConverter::toString [const]

Posted: Fri Jan 09, 2009 4:24 am
by RedEyeCoder
See here and here for more detailed information.