[crossfire] New type "sstring"?

Alex Schultz alex_sch at telus.net
Mon Mar 5 18:18:24 CST 2007


Nicolas Weeger wrote:
> I'd like to add a "typedef const char* sstring" and use that for relevant 
> members / variables. sstring is of course "shared_string".
>
> It wouldn't change much things, but clarify when the string is shared 
> (add_string / add_refcount) and when it's safe to alter it.
>
> Unless I'm mistaking the const char* <-> sstring conversion would be implicit, 
> so wouldn't need to change all functions immediately :)
>
> What do you think of that?
I'd say this would be a great idea as it would make it easier to tell in
the code when things are a shared string :)
I'm not 100% sure of the choice of that particular name 'sstring',
however I don't have any better alternatives in mind at the moment.

Alex Schultz



More information about the crossfire mailing list