Boost logo

Boost :

Subject: Re: [boost] hex/unhex()?
From: Olaf van der Spek (ml_at_[hidden])
Date: 2011-11-03 08:13:05


On Wed, Nov 2, 2011 at 9:43 PM, Marshall Clow <mclow.lists_at_[hidden]> wrote:
>>>> Doesn't it 'return' a std::string? If you dislike the current API a small
>>>> wrapper function can easily handle that.
>>>
>>> Right - like this (for example):
>>>
>>> std::string hexS ( const std::string &input ) {
>>>        std::string result;
>>>        result.reserve ( input.size () * 2 );   // Harry Harrison
>>>        hex ( input, std::back_inserter ( result ));
>>>        return result;
>>>        }
>>
>> Yep, except that it should not be limited to std::string.
>
>
> Goodness, you're picky.

Hehe

> First you say it needs to "just work on std::string", then you say it shouldn't be limited to std::string.
>
> The iterator-based versions (whose prototypes I posted earlier) work on just about everything.

So could a function like this be added to Boost?

Olaf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk