From acd364a04a0fdcb0f022f7f71baf9eb71d092daa Mon Sep 17 00:00:00 2001 From: klaus triendl Date: Sun, 10 Dec 2023 22:36:48 +0200 Subject: [PATCH] Assigned result of `constexpr` functions to `constexpr` variables (#237) --- include/boost/date_time/time_parsing.hpp | 2 +- include/boost/date_time/time_system_counted.hpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/boost/date_time/time_parsing.hpp b/include/boost/date_time/time_parsing.hpp index 98bedbf07..592dfbaa3 100644 --- a/include/boost/date_time/time_parsing.hpp +++ b/include/boost/date_time/time_parsing.hpp @@ -99,7 +99,7 @@ namespace date_time { fs = _atoi64(beg->c_str()); } #else - int precision = time_duration::num_fractional_digits(); + BOOST_CXX14_CONSTEXPR int precision = time_duration::num_fractional_digits(); if(digits >= precision) { // drop excess digits fs = boost::lexical_cast(beg->substr(0, precision)); diff --git a/include/boost/date_time/time_system_counted.hpp b/include/boost/date_time/time_system_counted.hpp index 6c27aded7..5221bc0fa 100644 --- a/include/boost/date_time/time_system_counted.hpp +++ b/include/boost/date_time/time_system_counted.hpp @@ -93,9 +93,8 @@ namespace date_time { } static BOOST_CXX14_CONSTEXPR int_type frac_sec_per_day() { - int_type seconds_per_day = 60*60*24; - int_type fractional_sec_per_sec(resolution_traits::res_adjust()); - return seconds_per_day*fractional_sec_per_sec; + BOOST_CXX14_CONSTEXPR int_type seconds_per_day = 60*60*24; + return seconds_per_day*resolution_traits::res_adjust(); } BOOST_CXX14_CONSTEXPR bool is_pos_infinity()const {