Skip to content

Commit f61b215

Browse files
committed
Ignore MSVC warnings
1 parent 1880ba4 commit f61b215

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

include/boost/decimal/charconv.hpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ namespace decimal {
4646

4747
namespace detail {
4848

49+
#ifdef _MSC_VER
50+
# pragma warning(push)
51+
# pragma warning(disable:4127)
52+
#endif
53+
4954
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
5055
constexpr auto from_chars_general_impl(const char* first, const char* last, TargetDecimalType& value, const chars_format fmt) noexcept -> from_chars_result
5156
{
@@ -102,13 +107,13 @@ constexpr auto from_chars_general_impl(const char* first, const char* last, Targ
102107

103108
BOOST_DECIMAL_IF_CONSTEXPR (!is_fast_type_v<TargetDecimalType>)
104109
{
105-
if (fmt == chars_format::cohort_preserving_scientific)
106-
{
107-
const auto sig_digs {detail::num_digits(significand)};
108-
if (sig_digs > precision_v<TargetDecimalType>)
110+
if (fmt == chars_format::cohort_preserving_scientific)
109111
{
110-
// If we are parsing more digits than are representable there's no concept of cohorts
111-
return {last, std::errc::value_too_large};
112+
const auto sig_digs {detail::num_digits(significand)};
113+
if (sig_digs > precision_v<TargetDecimalType>)
114+
{
115+
// If we are parsing more digits than are representable there's no concept of cohorts
116+
return {last, std::errc::value_too_large};
112117
}
113118
}
114119
}
@@ -118,6 +123,10 @@ constexpr auto from_chars_general_impl(const char* first, const char* last, Targ
118123
return r;
119124
}
120125

126+
#ifdef _MSC_VER
127+
# pragma warning(pop)
128+
#endif
129+
121130
} //namespace detail
122131

123132
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>

0 commit comments

Comments
 (0)