The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: mcalien on June 25, 2011, 07:45:59 PM

Title: Using C++-STL Classes
Post by: mcalien on June 25, 2011, 07:45:59 PM
When I studied the Simutrans source code, i found some not very efficiently working classes like hashtable_tpl<> and some very unsafe usages of c-strings like
free(const_cast<char *>(iter.get_current_key()));  (tabfile.cc/Line 71).
Is it possible to replace all the container classes with classes like std::map<>, std::vector<> and std::deque<> and to use std::string/std::wstring classes instead of char/wchar_t-pointers?
I tried to replace all the container classes by myself, but it's to much work for me and you can't test if it works until you finished to replace everythink.
Using the std::string class instead of c-strings should be easier, because you can do it step by step.

I think this would improve performance, stability and maintainability.
Title: Re: Using C++-STL Classes
Post by: TurfIt on June 25, 2011, 08:12:50 PM
See What platforms does Simutrans actually need to compile on? (http://forum.simutrans.com/index.php?topic=4838.0)