News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Using C++-STL Classes

Started by mcalien, June 25, 2011, 07:45:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mcalien

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.