diff options
author | Chris Robinson <[email protected]> | 2022-02-20 04:13:03 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-02-20 04:13:03 -0800 |
commit | 023ad6320be73d1cee3facad1722e94d7258f2bb (patch) | |
tree | 1bf32b6d4a3e26ac821c47935c5b36f01eeee601 /al/eax_fx_slot_index.h | |
parent | 0e26e0809d1aaa8501f310982b554565dc9e8beb (diff) |
Inline a couple more equality operators
Diffstat (limited to 'al/eax_fx_slot_index.h')
-rw-r--r-- | al/eax_fx_slot_index.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/al/eax_fx_slot_index.h b/al/eax_fx_slot_index.h index 2913ee8d..e1e5475a 100644 --- a/al/eax_fx_slot_index.h +++ b/al/eax_fx_slot_index.h @@ -10,7 +10,6 @@ using EaxFxSlotIndexValue = std::size_t; - class EaxFxSlotIndex : public al::optional<EaxFxSlotIndexValue> { public: @@ -27,12 +26,16 @@ private: static void fail(const char *message); }; // EaxFxSlotIndex -bool operator==( - const EaxFxSlotIndex& lhs, - const EaxFxSlotIndex& rhs) noexcept; - -bool operator!=( - const EaxFxSlotIndex& lhs, - const EaxFxSlotIndex& rhs) noexcept; +inline bool operator==(const EaxFxSlotIndex& lhs, const EaxFxSlotIndex& rhs) noexcept +{ + if(lhs.has_value() != rhs.has_value()) + return false; + if(lhs.has_value()) + return *lhs == *rhs; + return true; +} + +inline bool operator!=(const EaxFxSlotIndex& lhs, const EaxFxSlotIndex& rhs) noexcept +{ return !(lhs == rhs); } #endif // !EAX_FX_SLOT_INDEX_INCLUDED |