Allow types wider than int in \x{} expressions (for char32_t etc).

Fixes: https://svn.boost.org/trac/boost/ticket/11988.
This commit is contained in:
jzmaddock
2016-02-17 18:58:05 +00:00
parent 05dc9f4a44
commit 955d077d2b
10 changed files with 50 additions and 34 deletions

View File

@ -304,13 +304,13 @@ int global_value(charT c)
return -1;
}
template <class charT, class traits>
int global_toi(const charT*& p1, const charT* p2, int radix, const traits& t)
boost::intmax_t global_toi(const charT*& p1, const charT* p2, int radix, const traits& t)
{
(void)t; // warning suppression
int next_value = t.value(*p1, radix);
boost::intmax_t next_value = t.value(*p1, radix);
if((p1 == p2) || (next_value < 0) || (next_value >= radix))
return -1;
int result = 0;
boost::intmax_t result = 0;
while(p1 != p2)
{
next_value = t.value(*p1, radix);