On Fri, 2005-02-11 at 10:39 -0600, Jim Lear wrote:
No, fastcat does not exist. I'm suggesting that it may be easier for Chateauneu to create an optimized method (fastcat or such) that accepts multiple operands rather than wrestling with operators that accept only two operands.
You're probably right. You could do something like.
using std::string
void fastcat (string & dest, const string & s1);
void fastcat (string & dest, const string & s1, const string & s2);
etc
Explicit unrolling of the loops in my toy concat class. Unless you only
have a few cases you care about, this is tedious.
It's probably to use some template machinery and or preprocessor magic
to create a form that takes an arbitrary (up to some limit) number of
strings to concatenate.
Another option is to rely on the compilers intimate knowledge of it's
own library implementations to do all this for you. Don't know of real
compilers do this, but it seems like a reasonable request.
--
t. scott urban