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 » Sat Dec 27, 2008 2:10 pm

Is there a reason for StringConverter::toString methods not beeing const?
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: StringConverter::toString [const]

Post by jacmoe » Sat Dec 27, 2008 2:16 pm

The member functions are static and the parameter is const. Why would you want them to return consts?
It's just a utility class. :)
0 x
/* 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 » Sat Dec 27, 2008 2:31 pm

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?)
0 x

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7152
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 19

Re: StringConverter::toString [const]

Post by Kojack » Sat Dec 27, 2008 2:41 pm

You can't make a static methods const. It's not valid c++.
0 x

User avatar
RedEyeCoder
Gnome
Posts: 344
Joined: Sat Jun 16, 2007 7:29 am
Location: Brisbane, Australia

Re: StringConverter::toString [const]

Post by RedEyeCoder » Fri Jan 09, 2009 4:24 am

See here and here for more detailed information.
0 x

Post Reply