From: Gabriel M. B. <ga...@te...> - 2009-12-17 18:53:38
|
On Tue, 15 Dec 2009, Gabriel M. Beddingfield wrote: > However, a string class could be created that meets the requirement: > > template <typename CharT, size_t Max> > class RtString > { [snip] OK, for some reason I've been obsessed with this class for the past few days. You can find my work here: http://gitorious.org/composite/composite-labs/trees/master/200912-rtstring Especially the RtString.hpp header file. This class has been tested and is pretty stable now.[1] Not only is it real-time safe, but copying its contents to a char* buffer is real-time safe. On top of that, it's friggin' fast. I've benchmarked it as follows: RtString is 3x faster than std::ostream + std::string RtString is 5-6x faster than QString RtString is 5-6x faster than boost::format + std::string Comments are welcome! Peace, Gabriel [1] at least with CharT = char. |