StringConverter::toString [const]

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
TWO
Halfling
Posts: 61
Joined: Sat Jan 26, 2008 9:30 pm
Location: Germany
Contact:

StringConverter::toString [const]

Post by TWO »

Is there a reason for StringConverter::toString methods not beeing const?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: StringConverter::toString [const]

Post 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. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
darke
Halfling
Posts: 94
Joined: Mon Sep 08, 2008 3:30 am

Re: StringConverter::toString [const]

Post 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?)
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: StringConverter::toString [const]

Post by Kojack »

You can't make a static methods const. It's not valid c++.
User avatar
RedEyeCoder
Gnome
Posts: 344
Joined: Sat Jun 16, 2007 7:29 am
Location: Brisbane, Australia

Re: StringConverter::toString [const]

Post by RedEyeCoder »

See here and here for more detailed information.
Post Reply