Boost logo

Boost Users :

From: t. scott urban (scottu_at_[hidden])
Date: 2005-02-11 12:25:06


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 <scottu_at_[hidden]>

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net