From b0fcb1218120b2db49d1e8630c9da251844919bf Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Fri, 20 Nov 2020 14:25:49 +0100 Subject: [PATCH] This fixes the Visual Studio 2019 warning W26451 (Arithmetic overflow Using operator* on a 4 byte value and then casting the result to a 8 byte value.) --- include/boost/date_time/microsec_time_clock.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/date_time/microsec_time_clock.hpp b/include/boost/date_time/microsec_time_clock.hpp index 42a918b53..1bfd5ae82 100644 --- a/include/boost/date_time/microsec_time_clock.hpp +++ b/include/boost/date_time/microsec_time_clock.hpp @@ -122,7 +122,7 @@ namespace date_time { time_duration_type td(static_cast< typename time_duration_type::hour_type >(curr_ptr->tm_hour), static_cast< typename time_duration_type::min_type >(curr_ptr->tm_min), static_cast< typename time_duration_type::sec_type >(curr_ptr->tm_sec), - sub_sec * adjust); + static_cast< typename time_duration_type::fractional_seconds_type >(sub_sec) * adjust); return time_type(d,td); }