Skip to content

Commit

Permalink
Fix VS2015 compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Dec 18, 2020
1 parent edac0f6 commit dca9b4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rtc_base/numerics/safe_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ inline constexpr Dst dchecked_cast(Src value) {
// that the specified numeric conversion will saturate rather than overflow or
// underflow. NaN assignment to an integral will trigger a RTC_CHECK condition.
template <typename Dst, typename Src>
#if !defined(_MSC_VER) || (_MSC_VER > 1900)
inline constexpr Dst saturated_cast(Src value) {
#else
inline Dst saturated_cast(Src value) {
#endif
// Optimization for floating point values, which already saturate.
if (std::numeric_limits<Dst>::is_iec559)
return static_cast<Dst>(value);
Expand Down

0 comments on commit dca9b4f

Please sign in to comment.