diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-01-23 19:37:32 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-01-23 19:37:32 +0100 |
| commit | 6512dd599d13035f6a90b2009344e02c488f5aae (patch) | |
| tree | 5d19f043aac57c5cec6edc8221d5ec9057d49ab3 /src/nes/util/cycle_count.hh | |
| parent | baa585fd21f631708de215929241d40f66b58498 (diff) | |
initial working version
Diffstat (limited to 'src/nes/util/cycle_count.hh')
| -rw-r--r-- | src/nes/util/cycle_count.hh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nes/util/cycle_count.hh b/src/nes/util/cycle_count.hh index f8039c2..8afd40a 100644 --- a/src/nes/util/cycle_count.hh +++ b/src/nes/util/cycle_count.hh @@ -11,6 +11,7 @@ namespace nes class cycle_count { friend constexpr auto operator+(cycle_count, cycle_count) -> cycle_count; + friend constexpr auto operator-(cycle_count, cycle_count) -> cycle_count; friend constexpr auto operator*(std::uint64_t, cycle_count) -> cycle_count; friend constexpr auto operator*(cycle_count, std::uint64_t) -> cycle_count; friend constexpr auto operator/(cycle_count, cycle_count) -> std::uint64_t; @@ -79,6 +80,7 @@ namespace nes constexpr auto operator<=(cycle_count const a, cycle_count const b) -> bool { return a.get_units() <= b.get_units(); } constexpr auto operator>=(cycle_count const a, cycle_count const b) -> bool { return a.get_units() >= b.get_units(); } constexpr auto operator+(cycle_count const a, cycle_count const b) -> cycle_count { return cycle_count{ a.get_units() + b.get_units() }; } + constexpr auto operator-(cycle_count const a, cycle_count const b) -> cycle_count { return cycle_count{ a.get_units() - b.get_units() }; } constexpr auto operator*(std::uint64_t const a, cycle_count const b) -> cycle_count { return cycle_count{ a * b.get_units() }; } constexpr auto operator*(cycle_count const a, std::uint64_t const b) -> cycle_count { return cycle_count{ a.get_units() * b }; } constexpr auto operator/(cycle_count const a, cycle_count const b) -> std::uint64_t { return a.get_units() / b.get_units(); } |
