13
0

Temporal: fix implementation of timecnt_t::operator= (timecnt_t const &)

It is OK now to have inconsistent time domains inside a timecnt_t
This commit is contained in:
Paul Davis 2020-12-08 20:32:32 -07:00
parent 3900537fcf
commit 747281a244

View File

@ -375,15 +375,10 @@ class LIBTEMPORAL_API timecnt_t {
bool operator< (timecnt_t const & other) const { if (_distance.flagged() == other.distance().flagged()) return _distance < other.distance(); else return expensive_lt (other); }
bool operator<= (timecnt_t const & other) const { if (_distance.flagged() == other.distance().flagged()) return _distance <= other.distance(); else return expensive_gte (other); }
timecnt_t & operator=(timecnt_t const & other) {
timecnt_t & operator= (timecnt_t const & other) {
if (this != &other) {
if (_distance.flagged() == other.distance().flagged()) {
_distance = other.distance();
} else {
/* unclear what to do here but we cannot allow
inconsistent timecnt_t to be created
*/
}
_distance = other.distance();
_position = other.position();
}
return *this;
}