
9 Jun
2008
9 Jun
'08
11:31 p.m.
Hi! Matus Chochlik schrieb:
Other difference is my use of std::string as a return type. Seems you have a complex system to compute string length and use char*. Not sure which one is the best but I'm willing to hear the rationale behind this choice.
Well there is no bulletproof ;) rationale behind this. I've made some performance tests with both char* buffer and with ::std::string and char* buffer did better. When formatting the type name of a complicated template there is a lot of string copying and realocation.
Which is why there is a stringstream. You won't return anything but instead write into a ostream& directly. This reduces the complexity of the algorithm. Frank