@@ -115,6 +115,16 @@ class datetime
115115 {
116116 }
117117
118+ /* !
119+ * \brief Copy Constructor. Copy a tc::sdk::datetime instance to another one.
120+ */
121+ constexpr datetime (const datetime&) noexcept = default;
122+
123+ /* !
124+ * \brief Move Constructor. Copy a tc::sdk::datetime instance to another one.
125+ */
126+ constexpr datetime (datetime&&) noexcept = default;
127+
118128 /* !
119129 * \brief Assignment operator. Assign a tc::sdk::datetime instance to another one.
120130 */
@@ -166,24 +176,11 @@ class datetime
166176 }
167177
168178 /* !
169- * \brief Equality operator.
170- * \param other the datetime to compare against.
171- * \return true if the two datetime objects are the same.
172- */
173- constexpr inline bool operator ==(const datetime& other) const noexcept
174- {
175- return _tp == other._tp ;
176- }
177-
178- /* !
179- * \brief Inequality operator.
179+ * \brief Spaceship operator.
180180 * \param other the datetime to compare against.
181- * \return true if the two datetime objects are the different .
181+ * \return std::strong_ordering comparing two datetime objects.
182182 */
183- constexpr inline bool operator !=(const datetime& other) const noexcept
184- {
185- return !operator ==(other);
186- }
183+ constexpr auto operator <=>(const datetime& other) const noexcept = default ;
187184
188185 /* !
189186 * \brief Adds a timedelta to the current datetime.
@@ -205,26 +202,6 @@ class datetime
205202 return tc::sdk::datetime{_tp - delta.total_nanoseconds ()};
206203 }
207204
208- /* !
209- * \brief Checks if the current datetime is less than another datetime.
210- * \param other The datetime to compare against.
211- * \return true if the current datetime is less, false otherwise.
212- */
213- constexpr inline bool operator <(const datetime& other) const noexcept
214- {
215- return _tp < other._tp ;
216- }
217-
218- /* !
219- * \brief Checks if the current datetime is greater than another datetime.
220- * \param other The datetime to compare against.
221- * \return true if the current datetime is greater, false otherwise.
222- */
223- constexpr inline bool operator >(const datetime& other) const noexcept
224- {
225- return _tp > other._tp ;
226- }
227-
228205 /* !
229206 * \brief Calculates the time difference between two datetime objects.
230207 * \param other The datetime to subtract from the current datetime.
0 commit comments