|
6 | 6 | #include <algorithm> |
7 | 7 | #include <array> |
8 | 8 | #include <chrono> |
| 9 | +#include <compare> |
9 | 10 | #include <string_view> |
10 | 11 | #include <type_traits> |
11 | 12 | #include <vector> |
12 | 13 |
|
13 | 14 | #include <fmt/format.h> |
14 | 15 |
|
15 | | -#include <userver/compiler/impl/three_way_comparison.hpp> |
16 | 16 | #include <userver/utils/fmt_compat.hpp> |
17 | 17 |
|
18 | 18 | USERVER_NAMESPACE_BEGIN |
@@ -86,17 +86,7 @@ class TimeOfDay<std::chrono::duration<Rep, Period>> { |
86 | 86 |
|
87 | 87 | //@{ |
88 | 88 | /** @name Comparison operators */ |
89 | | - |
90 | | -#ifdef USERVER_IMPL_HAS_THREE_WAY_COMPARISON |
91 | 89 | constexpr auto operator<=>(const TimeOfDay&) const = default; |
92 | | -#else |
93 | | - constexpr bool operator==(const TimeOfDay&) const; |
94 | | - constexpr bool operator!=(const TimeOfDay&) const; |
95 | | - constexpr bool operator<(const TimeOfDay&) const; |
96 | | - constexpr bool operator<=(const TimeOfDay&) const; |
97 | | - constexpr bool operator>(const TimeOfDay&) const; |
98 | | - constexpr bool operator>=(const TimeOfDay&) const; |
99 | | -#endif |
100 | 90 | //@} |
101 | 91 |
|
102 | 92 | //@{ |
@@ -422,38 +412,6 @@ constexpr TimeOfDay<std::chrono::duration<Rep, Period>>::TimeOfDay(std::string_v |
422 | 412 | : since_midnight_{detail::TimeOfDayParser<Rep, Period>{}(str)} |
423 | 413 | {} |
424 | 414 |
|
425 | | -#ifndef USERVER_IMPL_HAS_THREE_WAY_COMPARISON |
426 | | -template <typename Rep, typename Period> |
427 | | -constexpr bool TimeOfDay<std::chrono::duration<Rep, Period>>::operator==(const TimeOfDay& rhs) const { |
428 | | - return since_midnight_ == rhs.since_midnight_; |
429 | | -} |
430 | | - |
431 | | -template <typename Rep, typename Period> |
432 | | -constexpr bool TimeOfDay<std::chrono::duration<Rep, Period>>::operator!=(const TimeOfDay& rhs) const { |
433 | | - return !(*this == rhs); |
434 | | -} |
435 | | - |
436 | | -template <typename Rep, typename Period> |
437 | | -constexpr bool TimeOfDay<std::chrono::duration<Rep, Period>>::operator<(const TimeOfDay& rhs) const { |
438 | | - return since_midnight_ < rhs.since_midnight_; |
439 | | -} |
440 | | - |
441 | | -template <typename Rep, typename Period> |
442 | | -constexpr bool TimeOfDay<std::chrono::duration<Rep, Period>>::operator<=(const TimeOfDay& rhs) const { |
443 | | - return since_midnight_ <= rhs.since_midnight_; |
444 | | -} |
445 | | - |
446 | | -template <typename Rep, typename Period> |
447 | | -constexpr bool TimeOfDay<std::chrono::duration<Rep, Period>>::operator>(const TimeOfDay& rhs) const { |
448 | | - return since_midnight_ > rhs.since_midnight_; |
449 | | -} |
450 | | - |
451 | | -template <typename Rep, typename Period> |
452 | | -constexpr bool TimeOfDay<std::chrono::duration<Rep, Period>>::operator>=(const TimeOfDay& rhs) const { |
453 | | - return since_midnight_ >= rhs.since_midnight_; |
454 | | -} |
455 | | -#endif |
456 | | - |
457 | 415 | template <typename Rep, typename Period> |
458 | 416 | constexpr std::chrono::minutes TimeOfDay<std::chrono::duration<Rep, Period>>::Minutes() const noexcept { |
459 | 417 | if constexpr (detail::kHasMinutes<Period>) { |
|
0 commit comments