diff options
Diffstat (limited to 'al/eax_fx_slot_index.h')
-rw-r--r-- | al/eax_fx_slot_index.h | 47 |
1 files changed, 8 insertions, 39 deletions
diff --git a/al/eax_fx_slot_index.h b/al/eax_fx_slot_index.h index 95ff9313..2913ee8d 100644 --- a/al/eax_fx_slot_index.h +++ b/al/eax_fx_slot_index.h @@ -4,59 +4,29 @@ #include <cstddef> +#include "aloptional.h" #include "eax_api.h" using EaxFxSlotIndexValue = std::size_t; -class EaxFxSlotIndex +class EaxFxSlotIndex : public al::optional<EaxFxSlotIndexValue> { public: - EaxFxSlotIndex() noexcept = default; + using al::optional<EaxFxSlotIndexValue>::optional; - EaxFxSlotIndex( - EaxFxSlotIndexValue index); - - EaxFxSlotIndex( - const EaxFxSlotIndex& rhs) noexcept; - - void operator=( - EaxFxSlotIndexValue index); - - void operator=( - const GUID& guid); - - void operator=( - const EaxFxSlotIndex& rhs) noexcept; - - - bool has_value() const noexcept; - - EaxFxSlotIndexValue get() const; - - void reset() noexcept; - - void set( - EaxFxSlotIndexValue index); - - void set( - const GUID& guid); - - operator EaxFxSlotIndexValue() const; + EaxFxSlotIndex& operator=(const EaxFxSlotIndexValue &value) { set(value); return *this; } + EaxFxSlotIndex& operator=(const GUID &guid) { set(guid); return *this; } + void set(EaxFxSlotIndexValue index); + void set(const GUID& guid); private: [[noreturn]] - static void fail( - const char* message); - - - bool has_value_{}; - EaxFxSlotIndexValue value_{}; + static void fail(const char *message); }; // EaxFxSlotIndex - bool operator==( const EaxFxSlotIndex& lhs, const EaxFxSlotIndex& rhs) noexcept; @@ -65,5 +35,4 @@ bool operator!=( const EaxFxSlotIndex& lhs, const EaxFxSlotIndex& rhs) noexcept; - #endif // !EAX_FX_SLOT_INDEX_INCLUDED |