
1 Nov
2011
1 Nov
'11
11:20 p.m.
On 2 November 2011 00:05, Olaf van der Spek <ml@vdspek.org> wrote:
On Tue, Nov 1, 2011 at 11:32 PM, Marshall Clow <mclow.lists@gmail.com> wrote:
std::string input ( "61626f6465" ); std::string result; unhex ( input.begin(), input.end (), std::back_inserter(result));
---> result should contain "abode"
I seem to have misinterpreted your initial request (I thought you were taking about parsing / generating hexadecimal numbers), what's described above isn't supported my boost.coerce, sorry.
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
Jeroen