Skip to content

Commit 8a9000e

Browse files
[Trajectory] Implement operator= to fix compilation warning.
1 parent d49cab8 commit 8a9000e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

include/sot/core/trajectory.hh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ class SOT_CORE_EXPORT timestamp {
9898
if ((secs_ != other.secs_) || (nsecs_ != other.nsecs_)) return false;
9999
return true;
100100
}
101-
friend std::ostream &operator<<(std::ostream &stream, const timestamp &ats) {
101+
timestamp &operator=(const timestamp &other) {
102+
secs_ = other.secs_;
103+
nsecs_ = other.nsecs_;
104+
return *this;
105+
}
106+
friend std::ostream &operator<<(std::ostream &stream, const timestamp &ats) {
102107
stream << ats.secs_ + 0.000001 * (long double)ats.nsecs_;
103108
return stream;
104109
}

0 commit comments

Comments
 (0)