there seems to be no reasonable form which avoids warnings with all compilers; so let's use a clear style and filter explicitly the VC warning

[SVN r34820]
This commit is contained in:
Gennaro Prota
2006-08-05 22:45:53 +00:00
parent c5bc634015
commit 795b7e1809

View File

@@ -136,20 +136,21 @@ namespace boost
{ {
stream.unsetf(std::ios::skipws); stream.unsetf(std::ios::skipws);
// The odd style used below is to avoid spurious compiler #if (defined _MSC_VER)
// warnings about using is_specialized as a (constant) # pragma warning( push )
// conditional expression // conditional expression is constant
# pragma warning( disable : 4127 )
typedef std::numeric_limits<Target> t; typedef std::numeric_limits<Target> t;
typedef std::numeric_limits<Source> s; typedef std::numeric_limits<Source> s;
bool setup_target = t::is_specialized; if(t::is_specialized)
if (setup_target) stream.precision(1 + t::digits10);
stream.precision(t::digits10 + 1); else if(s::is_specialized)
else stream.precision(1 + s::digits10);
((s::is_specialized) &&
stream.precision(s::digits10 + 1));
# pragma warning( pop )
#endif
} }
~lexical_stream() ~lexical_stream()