Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

String or Char*

Name: Anonymous 2010-07-19 22:24

What does /prog/ like better?

I personally like string

Name: 26 2010-07-20 22:48

>>29
I didn't say immutability is hard, I said memory compaction is hard. That is extremely difficult in C++ because you pretty much need a stop-the-world or memory barriers everywhere, not to mention pointer indirection and various other restrictions on raw string access.

>>31
except with indirection built in so that the string data could be allocated from a special zone that compacts memory
That's what the Allocator template parameter is for!
What the fuck. Does no one know what compacting memory means? You can't use a regular string implementation because you can't use regular pointers; they have to be indirect so you can move memory.

By the way, thanks for misunderstanding my post and giving me a completely pedestrian explanation for a ref-counted immutable string class. Please learn how the JVM compacts memory, then re-read >>26 and tell me how you are going to implement that in C++. Go ahead and implement it for me and I'll give you one free internet. Honest.

>>31
Asiatic character sets tend to use up less memory when in UTF-16 encoding, and a lot of games usually end up getting localized for Japan and Korea at some point.
Who cares? It's a video game. I bet a single texture in your game uses more memory than all the text for a level. Two whole megabytes for a level's strings; yeah that's something all right!

A custom string library makes sense for applications that deal primarily with text (think word processors, browsers, etc.) I've always just used std::string with UTF-8 for games because text is such a minor part of modern games.

>>35
And just because the game text is using u16string doesn't mean you can't be using u8string for internal developer strings, string based identifiers, etc.
That's a horrible idea. You've now got two different string types to deal with for no reason at all.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List