Cleared -Wunused-but-set-variable from GCC 4.8 and GCC 5.1. The way to handle separators is via locales and facets
parent
cf43ed07e3
commit
81aa87df02
12
integer.cpp
12
integer.cpp
|
|
@ -3376,24 +3376,21 @@ std::istream& operator>>(std::istream& in, Integer &a)
|
||||||
std::ostream& operator<<(std::ostream& out, const Integer &a)
|
std::ostream& operator<<(std::ostream& out, const Integer &a)
|
||||||
{
|
{
|
||||||
// Get relevant conversion specifications from ostream.
|
// Get relevant conversion specifications from ostream.
|
||||||
long f = out.flags() & std::ios::basefield; // Get base digits.
|
const long f = out.flags() & std::ios::basefield; // Get base digits.
|
||||||
int base, block;
|
int base;
|
||||||
char suffix;
|
char suffix;
|
||||||
switch(f)
|
switch(f)
|
||||||
{
|
{
|
||||||
case std::ios::oct :
|
case std::ios::oct :
|
||||||
base = 8;
|
base = 8;
|
||||||
block = 8;
|
|
||||||
suffix = 'o';
|
suffix = 'o';
|
||||||
break;
|
break;
|
||||||
case std::ios::hex :
|
case std::ios::hex :
|
||||||
base = 16;
|
base = 16;
|
||||||
block = 4;
|
|
||||||
suffix = 'h';
|
suffix = 'h';
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
base = 10;
|
base = 10;
|
||||||
block = 3;
|
|
||||||
suffix = '.';
|
suffix = '.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3424,11 +3421,8 @@ std::ostream& operator<<(std::ostream& out, const Integer &a)
|
||||||
}
|
}
|
||||||
|
|
||||||
while (i--)
|
while (i--)
|
||||||
{
|
|
||||||
out << s[i];
|
out << s[i];
|
||||||
// if (i && !(i%block))
|
|
||||||
// out << ",";
|
|
||||||
}
|
|
||||||
return out << suffix;
|
return out << suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue