Boost logo

Boost :

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


On Tue, Nov 1, 2011 at 11:32 PM, Marshall Clow <mclow.lists_at_[hidden]> wrote:
>        std::string input ( "61626f6465" );
>        std::string result;
>        unhex ( input.begin(), input.end (), std::back_inserter(result));
>
>        ---> result should contain "abode"

That one does not return std::string. It's also sub-optimal.

>> How would your unhex() flag an error?
>
> Throw an exception.

Hmm. I'd like to see a non-throwing variant as well.

-- 
Olaf

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