Merge pull request #324 from MaxG87/constexpr

Minor improvements on Key union
pull/330/head
Jesse Vincent 7 years ago committed by GitHub
commit 7f92a9086a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,41 +26,41 @@ union Key {
};
uint16_t raw;
inline bool operator==(uint16_t rhs) {
constexpr bool operator==(const uint16_t rhs) const {
return this->raw == rhs;
}
inline bool operator==(const Key rhs) {
constexpr bool operator==(const Key& rhs) const {
return this->raw == rhs.raw;
}
inline Key& operator=(uint16_t raw) {
Key& operator=(const uint16_t raw) {
this->raw = raw;
return *this;
}
inline bool operator!=(const Key& rhs) {
constexpr bool operator!=(const Key& rhs) const {
return !(*this == rhs);
}
inline bool operator>=(uint16_t raw) {
constexpr bool operator>=(const uint16_t raw) const {
return this->raw >= raw;
}
inline bool operator<=(uint16_t raw) {
constexpr bool operator<=(const uint16_t raw) const {
return this->raw <= raw;
}
inline bool operator>(uint16_t raw) {
constexpr bool operator>(const uint16_t raw) const {
return this->raw > raw;
}
inline bool operator<(uint16_t raw) {
constexpr bool operator<(const uint16_t raw) const {
return this->raw < raw;
}
inline bool operator>=(const Key& other) {
constexpr bool operator>=(const Key& other) const {
return this->raw >= other.raw;
}
inline bool operator<=(const Key& other) {
constexpr bool operator<=(const Key& other) const {
return this->raw <= other.raw;
}
inline bool operator>(const Key& other) {
constexpr bool operator>(const Key& other) const {
return this->raw > other.raw;
}
inline bool operator<(const Key& other) {
constexpr bool operator<(const Key& other) const {
return this->raw < other.raw;
}
};

Loading…
Cancel
Save