Skip to content

Commit 38d91c4

Browse files
committed
Move warning suppression
1 parent 6a17cd5 commit 38d91c4

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

examples/format.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
// Distributed under the Boost Software License, Version 1.0.
33
// https://www.boost.org/LICENSE_1_0.txt
44

5-
// MSVC 14.3 has a conversion error in <algorithm> so we need to try and supress that everywhere
6-
#ifdef _MSC_VER
7-
# pragma warning(push)
8-
# pragma warning(disable : 4244)
9-
#endif
10-
115
#include <boost/decimal.hpp>
126
#include <iostream>
137

include/boost/decimal/format.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,18 @@ struct formatter<T>
143143

144144
if (is_upper)
145145
{
146+
#ifdef _MSC_VER
147+
# pragma warning(push)
148+
# pragma warning(disable : 4244)
149+
#endif
150+
146151
std::transform(s.begin(), s.end(), s.begin(),
147152
[](unsigned char c)
148153
{ return std::toupper(c); });
154+
155+
#ifdef _MSC_VER
156+
# pragma warning(pop)
157+
#endif
149158
}
150159

151160
if (s.size() < static_cast<std::size_t>(padding_digits))

test/test_format.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
// Distributed under the Boost Software License, Version 1.0.
33
// https://www.boost.org/LICENSE_1_0.txt
44

5-
// MSVC 14.3 has a conversion error in <algorithm> so we need to try and supress that everywhere
6-
#ifdef _MSC_VER
7-
# pragma warning(push)
8-
# pragma warning(disable : 4244)
9-
#endif
10-
115
#include <boost/decimal.hpp>
126
#include <boost/core/lightweight_test.hpp>
137
#include <limits>

0 commit comments

Comments
 (0)