Skip to content
Permalink
Browse files

Merge pull request #8287 from lioncash/static-ctor

DiscIO/Volume: Make Partition's interface constexpr
  • Loading branch information...
JosJuice committed Aug 3, 2019
2 parents 7afba67 + db3b31c commit 27707075876abe0f89bcb7d7549d3036a75a92af
Showing with 10 additions and 10 deletions.
  1. +10 −10 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
{

0 comments on commit 2770707

Please sign in to comment.
You can’t perform that action at this time.