Put hex_char_to_int in an unnamed namespace to fix linker errors

[SVN r80696]
This commit is contained in:
Marshall Clow
2012-09-24 18:00:07 +00:00
parent ed9b65dc39
commit 87f97645da

View File

@ -69,6 +69,10 @@ namespace detail {
return std::copy ( res, res + num_hex_digits, out );
}
// this needs to be in an un-named namespace because it is not a template
// and might get included in several compilation units. This could cause
// multiple definition errors at link time.
namespace {
unsigned hex_char_to_int ( char c ) {
if ( c >= '0' && c <= '9' ) return c - '0';
if ( c >= 'A' && c <= 'F' ) return c - 'A' + 10;
@ -76,7 +80,7 @@ namespace detail {
BOOST_THROW_EXCEPTION (non_hex_input() << bad_char (c));
return 0; // keep dumb compilers happy
}
}
// My own iterator_traits class.
// It is here so that I can "reach inside" some kinds of output iterators