Subject: Re: [boost] [format] Any interest in decoupling it from std::basic_string?
From: Luke Elliott (lukester_null_at_[hidden])
Date: 2012-07-05 14:30:12
On 05/07/2012 18:53, Olaf van der Spek wrote:
> On Thu, Jul 5, 2012 at 6:44 PM, Luke Elliott <lukester_null_at_[hidden]> wrote:
>>> Right. So what exactly is the problem?
>>> Return type of format::str()?
>> Well "problem" is a bit strong, but str() is the issue with using
>> alternative strings with "no" changes to client code AFAICT. I'm sure there
> Because std::string can't be assigned to the alternative string type?
Yes. lexical_cast works, and obviously .c_str()/.length() could be used
but instead of a 50-odd line patch to boost.format that's a whole load
more changes to a lot of client code... plus whilst I don't care about
format performance, I'm not sure I don't care about it enough to not
care about additional string construction :)
>> are many other ways to achieve the same result, but this is the least
>> intrusive for me.
>> Anyway, no big deal if there's no interest - it doesn't seem like there's
>> much development of format these days so it's not like it's going to be much
>> effort with each new boost release to keep the patch up-to-date.
>> (I guess there's also no interest in a hack around the (format("%u") %
>> byte_t(65)) == "A" problem...)
> I've been bitten by that one too and wouldn't mind seeing a solution.
Well I've attached my hack. I'm sure it's wrong in lots of ways but
kinda does the trick, for some definition of kinda.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk