From 4730bffa1f9a148de9ad1c7e3adf7e5c3badcaba Mon Sep 17 00:00:00 2001 From: "U.G. Wilson" Date: Sun, 17 Jan 2016 02:26:51 -0600 Subject: [PATCH] Changed constant consts to constexpr --- src/convert.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/convert.cpp b/src/convert.cpp index 4bf3d8d..3871413 100644 --- a/src/convert.cpp +++ b/src/convert.cpp @@ -84,8 +84,8 @@ Node convert>::encode( const std::chrono::time_point& rhs ) { // Constants - const uint16_t MS_PER_S = 1000; - const uint16_t TM_BASE_YEAR = 1900; + constexpr uint16_t MS_PER_S = 1000; + constexpr uint16_t TM_BASE_YEAR = 1900; std::time_t tt = std::chrono::system_clock::to_time_t(rhs); std::tm utc_tm = *std::gmtime(&tt); @@ -116,12 +116,12 @@ bool convert>::decode( if (!node.IsScalar()) { return false; } // Constants - const uint16_t TM_BASE_YEAR = 1900; - const uint16_t MIN_PER_HR = 60; - const uint16_t MS_PER_S = 1000; - const uint16_t S_PER_MIN = 60; - const uint16_t S_PER_HR = 3600; - const uint32_t S_PER_DAY = 86400; + constexpr uint16_t TM_BASE_YEAR = 1900; + constexpr uint16_t MIN_PER_HR = 60; + constexpr uint16_t MS_PER_S = 1000; + constexpr uint16_t S_PER_MIN = 60; + constexpr uint16_t S_PER_HR = 3600; + constexpr uint32_t S_PER_DAY = 86400; const std::string s = node.Scalar();