diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-26 10:27:47 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-26 15:04:16 -0700 |
commit | 34807ca9fccc7425573256645024722571ef4442 (patch) | |
tree | 5e716b7fa2d786b15da403072bb6f41f3dfbcc65 /src/mmo | |
parent | b353ae37eb6d374aec4127f1849a5dce81f812b5 (diff) | |
download | tmwa-34807ca9fccc7425573256645024722571ef4442.tar.gz tmwa-34807ca9fccc7425573256645024722571ef4442.tar.bz2 tmwa-34807ca9fccc7425573256645024722571ef4442.tar.xz tmwa-34807ca9fccc7425573256645024722571ef4442.zip |
specialize inventory/storage indices
Diffstat (limited to 'src/mmo')
-rw-r--r-- | src/mmo/version.hpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/mmo/version.hpp b/src/mmo/version.hpp index 5d28b5d..f2c146b 100644 --- a/src/mmo/version.hpp +++ b/src/mmo/version.hpp @@ -47,6 +47,35 @@ struct Version uint8_t which; uint16_t vend; // can't add vendor name yet + + constexpr friend + bool operator < (Version l, Version r) + { + return (l.major < r.major + || (l.major == r.major + && (l.minor < r.minor + || (l.minor == r.minor + && (l.patch < r.patch + || (l.patch == r.patch + && (l.devel < r.devel + || (l.devel == r.devel + && l.vend < r.vend)))))))); + } + constexpr friend + bool operator > (Version l, Version r) + { + return r < l; + } + constexpr friend + bool operator <= (Version l, Version r) + { + return !(r < l); + } + constexpr friend + bool operator >= (Version l, Version r) + { + return !(l < r); + } }; static_assert(sizeof(Version) == 8, "this is sent over the network, can't change"); @@ -60,33 +89,4 @@ extern LString CURRENT_VERSION_STRING; bool extract(XString str, Version *vers); -constexpr -bool operator < (Version l, Version r) -{ - return (l.major < r.major - || (l.major == r.major - && (l.minor < r.minor - || (l.minor == r.minor - && (l.patch < r.patch - || (l.patch == r.patch - && (l.devel < r.devel - || (l.devel == r.devel - && l.vend < r.vend)))))))); -} -constexpr -bool operator > (Version l, Version r) -{ - return r < l; -} -constexpr -bool operator <= (Version l, Version r) -{ - return !(r < l); -} -constexpr -bool operator >= (Version l, Version r) -{ - return !(l < r); -} - #endif // TMWA_MMO_VERSION_HPP |