Is there a blitz ++ library equivalent for strings (i.e. a library that improves the performance of string construction / manipulation by delaying the construction of the string until the entire expression has been read)?
Blitz ++ improves the speed of matrix / vector operations by metaprogramming patterns by creating a "syntax tree" at compile time from expressions like A + B + C , and then evaluating the syntax tree. This method could, for example, improve string concatenation performance, because after looking at an expression like s1 + s2 + s3 size of the result will be known, so that memory allocation and copying can then be performed in one step, rather than first allocating memory for s1 + s2 . copying, allocating memory for (s1 + s2) + s3 , and then copying again.
Johnb source share