summaryrefslogtreecommitdiff
path: root/include/CommonAPI/Enumeration.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/CommonAPI/Enumeration.hpp')
-rw-r--r--include/CommonAPI/Enumeration.hpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/include/CommonAPI/Enumeration.hpp b/include/CommonAPI/Enumeration.hpp
index 1a4d5f4..da0372d 100644
--- a/include/CommonAPI/Enumeration.hpp
+++ b/include/CommonAPI/Enumeration.hpp
@@ -8,11 +8,11 @@
namespace CommonAPI {
-template <typename _Base>
+template<typename _Base>
struct Enumeration {
Enumeration() = default;
- Enumeration(const _Base &_value)
- : value_(_value) {
+ Enumeration(const _Base &_value) :
+ value_(_value) {
}
inline Enumeration &operator=(const _Base &_value) {
@@ -24,12 +24,28 @@ struct Enumeration {
return value_;
}
- inline bool operator == (const Enumeration<_Base> &_other) const {
- return value_ == _other.value_;
+ inline bool operator==(const Enumeration<_Base> &_other) const {
+ return (value_ == _other.value_);
}
- inline bool operator != (const Enumeration<_Base> &_other) const {
- return value_ != _other.value_;
+ inline bool operator!=(const Enumeration<_Base> &_other) const {
+ return (value_ != _other.value_);
+ }
+
+ inline bool operator<(const Enumeration<_Base> &_other) const {
+ return (value_ < _other.value_);
+ }
+
+ inline bool operator<=(const Enumeration<_Base> &_other) const {
+ return (value_ <= _other.value_);
+ }
+
+ inline bool operator>(const Enumeration<_Base> &_other) const {
+ return (value_ > _other.value_);
+ }
+
+ inline bool operator>=(const Enumeration<_Base> &_other) const {
+ return (value_ >= _other.value_);
}
_Base value_;