Skip to content

Commit 7d377b0

Browse files
committed
Fix if constexpr path for pre-c++17
1 parent 8376fd6 commit 7d377b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/boost/int128/numeric.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ constexpr TargetType saturate_cast(const uint128_t value) noexcept
201201
{
202202
BOOST_INT128_IF_CONSTEXPR (std::is_same<uint128_t, TargetType>::value)
203203
{
204-
return value;
204+
return static_cast<TargetType>(value);
205205
}
206206
else
207207
{
@@ -223,7 +223,7 @@ constexpr TargetType saturate_cast(const int128_t value) noexcept
223223
{
224224
BOOST_INT128_IF_CONSTEXPR (std::is_same<int128_t, TargetType>::value)
225225
{
226-
return value;
226+
return static_cast<TargetType>(value);
227227
}
228228
#if defined(BOOST_INT128_HAS_INT128) || defined(BOOST_INT128_HAS_MSVC_INT128)
229229
else BOOST_INT128_IF_CONSTEXPR (std::is_same<uint128_t, TargetType>::value || std::is_same<detail::builtin_u128, TargetType>::value)

0 commit comments

Comments
 (0)