diff options
| author | JosJuice <josjuice@gmail.com> | 2019-08-03 10:07:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-03 10:07:53 +0200 |
| commit | 27707075876abe0f89bcb7d7549d3036a75a92af (patch) | |
| tree | c0579807f6edc78dee5912fbfdca4a333cdfe01e /Source/Core/DiscIO | |
| parent | 7afba6776f187a1bb9f445b806e7fd52adc3dd6a (diff) | |
| parent | db3b31c2463a4dfa3caaa416a5d3c9ab8a59889b (diff) | |
Merge pull request #8287 from lioncash/static-ctor
DiscIO/Volume: Make Partition's interface constexpr
Diffstat (limited to 'Source/Core/DiscIO')
| -rw-r--r-- | Source/Core/DiscIO/Volume.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/Core/DiscIO/Volume.h b/Source/Core/DiscIO/Volume.h index a26db94370..05325aced2 100644 --- a/Source/Core/DiscIO/Volume.h +++ b/Source/Core/DiscIO/Volume.h @@ -26,18 +26,18 @@ class VolumeWAD; struct Partition final { - Partition() : offset(std::numeric_limits<u64>::max()) {} - explicit Partition(u64 offset_) : offset(offset_) {} - bool operator==(const Partition& other) const { return offset == other.offset; } - bool operator!=(const Partition& other) const { return !(*this == other); } - bool operator<(const Partition& other) const { return offset < other.offset; } - bool operator>(const Partition& other) const { return other < *this; } - bool operator<=(const Partition& other) const { return !(*this < other); } - bool operator>=(const Partition& other) const { return !(*this > other); } - u64 offset; + constexpr Partition() = default; + constexpr explicit Partition(u64 offset_) : offset(offset_) {} + constexpr bool operator==(const Partition& other) const { return offset == other.offset; } + constexpr bool operator!=(const Partition& other) const { return !(*this == other); } + constexpr bool operator<(const Partition& other) const { return offset < other.offset; } + constexpr bool operator>(const Partition& other) const { return other < *this; } + constexpr bool operator<=(const Partition& other) const { return !(*this < other); } + constexpr bool operator>=(const Partition& other) const { return !(*this > other); } + u64 offset{std::numeric_limits<u64>::max()}; }; -const Partition PARTITION_NONE(std::numeric_limits<u64>::max() - 1); +constexpr Partition PARTITION_NONE(std::numeric_limits<u64>::max() - 1); class Volume { |
