Source: come cmFileTime methods are constexpr for C++14

This commit is contained in:
AJIOB authored and Alex Overchenko committed 2026-10-21 12:13:26 -04:00
1 parent e343233110
commit ae180314b6
1 file changed
+6 -4
+6 -4
View File
@@ -6,6 +6,8 @@
#include <string>
#include <cm/bits/constexpr.hxx>
/** \class cmFileTime
* \brief Abstract file modification time with support for comparison with
* other file modification times.
@@ -62,7 +64,7 @@ public:
* @brief Compare file modification times.
* @return -1, 0, +1 for this older, same, or newer than ftm.
*/
int Compare(cmFileTime ftm) const
CONSTEXPR_CXX14 int Compare(cmFileTime ftm) const
{
TimeType const diff = this->Time - ftm.Time;
if (diff == 0) {
@@ -92,7 +94,7 @@ public:
/**
* @brief Return true if this is within the same second as ftm
*/
bool EqualS(cmFileTime ftm) const
CONSTEXPR_CXX14 bool EqualS(cmFileTime ftm) const
{
TimeType diff = this->Time - ftm.Time;
if (diff < 0) {
@@ -104,7 +106,7 @@ public:
/**
* @brief Return true if this is older or newer than ftm by at least a second
*/
bool DifferS(cmFileTime ftm) const
CONSTEXPR_CXX14 bool DifferS(cmFileTime ftm) const
{
TimeType diff = this->Time - ftm.Time;
if (diff < 0) {
@@ -118,7 +120,7 @@ public:
* @return -1: this at least a second older, 0: this within the same second
* as ftm, +1: this at least a second newer than ftm.
*/
int CompareS(cmFileTime ftm) const
CONSTEXPR_CXX14 int CompareS(cmFileTime ftm) const
{
TimeType const diff = this->Time - ftm.Time;
if (diff <= -cmFileTime::UtPerS) {