Make LLDate a trivial copyable/movable type

meow-7.2.2
Rye Mutt 2024-07-04 13:01:02 -04:00
parent 6cf176900f
commit f6d2536e4f
2 changed files with 3 additions and 15 deletions

View File

@ -41,20 +41,11 @@
#include "llstring.h"
#include "llfasttimer.h"
static const F64 DATE_EPOCH = 0.0;
static const F64 LL_APR_USEC_PER_SEC = 1000000.0;
// should be APR_USEC_PER_SEC, but that relies on INT64_C which
// isn't defined in glib under our build set up for some reason
LLDate::LLDate() : mSecondsSinceEpoch(DATE_EPOCH)
{}
LLDate::LLDate(const LLDate& date) :
mSecondsSinceEpoch(date.mSecondsSinceEpoch)
{}
LLDate::LLDate(F64SecondsImplicit seconds_since_epoch) :
mSecondsSinceEpoch(seconds_since_epoch.value())
{}

View File

@ -43,16 +43,13 @@
*/
class LL_COMMON_API LLDate
{
static constexpr F64 DATE_EPOCH = 0.0;
public:
/**
* @brief Construct a date equal to epoch.
*/
LLDate();
/**
* @brief Construct a date equal to the source date.
*/
LLDate(const LLDate& date);
constexpr LLDate() : mSecondsSinceEpoch(DATE_EPOCH)
{}
/**
* @brief Construct a date from a seconds since epoch value.