Yeah I just found that out, trying to find out while tr1::unordered_map won't take my hash function (which merely send out the uint uid). Technically we don't need a hashing function, the == operator should suffix, right? I'm a bit out of my element with templates, I tend to avoid them.Klaim wrote:You will need hashing functions or add an operator to convert implicitely to the uint because names are mostly used in (hash)maps.
Or at least a < operator.
Yeah, I already added a toString() methodMay I also minor suggestions:
- add a to_string() free function (like the new to_string() standard functions) that convert the id value to a String, either via it's member, or by searching in the name "database" or something;

Sure thing, Ogre::Id? EDIT: Or Ogre:Uid? I think Ogre::Id is more correct, since the class itself doesn't guarantee uniqueness, that's enforced by the users of the class, but w/e you like.- change the name to something shorter as it will be used in a lot of interfaces;
The idea here is that the strings are optional and not used for comparison, a convenience to not lose the functionality. Personally I couldn't be less interested in using strings for any purpose since I prefer Ogre to be a thin layer, but since apparently some folks here like the functionality I'm trying to keep it somehow.It's not clear to me how you intend to store the strings exactly? Have a Singleton id->name table?
So the idea is simply that the Ogre::Id object holds a pointer to a string, and that pointer will be NULL by default, which means that if you are not interested in strings you are only wasting a 4 bytes in memory per id and no performance overhead at all.