Skip to content

Commit

Permalink
fix: fix c++20 compile
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN authored Apr 14, 2024
1 parent 618d1d3 commit ec83f0a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/mc/deps/core/mce/Blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class Blob {
public:
delete_function mFn;

[[nodiscard]] constexpr Deleter() : mFn(Blob::defaultDeleter) {}
[[nodiscard]] _CONSTEXPR23 Deleter() : mFn(Blob::defaultDeleter) {}

[[nodiscard]] constexpr Deleter(delete_function fn) : mFn(fn) {}
[[nodiscard]] _CONSTEXPR23 Deleter(delete_function fn) : mFn(fn) {}

void operator()(pointer x) const { mFn(x); }
};
Expand All @@ -31,9 +31,9 @@ class Blob {
pointer_type mBlob{}; // this+0x0
size_type mSize{}; // this+0x10

[[nodiscard]] constexpr Blob() = default;
[[nodiscard]] _CONSTEXPR23 Blob() = default;

[[nodiscard]] constexpr Blob(std::span<uchar> s, Deleter deleter = {}) : mSize(s.size()) { // NOLINT
[[nodiscard]] _CONSTEXPR23 Blob(std::span<uchar> s, Deleter deleter = {}) : mSize(s.size()) { // NOLINT
mBlob = pointer_type(new value_type[mSize], deleter);
std::copy(s.begin(), s.end(), mBlob.get());
}
Expand All @@ -45,11 +45,11 @@ class Blob {
[[nodiscard]] constexpr std::span<uchar> view() const { return {data(), size()}; }

LL_CLANG_CEXPR Blob& operator=(Blob&&) noexcept = default;
[[nodiscard]] constexpr Blob(Blob&&) noexcept = default;
[[nodiscard]] _CONSTEXPR23 Blob(Blob&&) noexcept = default;

[[nodiscard]] constexpr Blob(Blob const& other) : Blob(other.view(), other.mBlob.get_deleter()) {}
[[nodiscard]] _CONSTEXPR23 Blob(Blob const& other) : Blob(other.view(), other.mBlob.get_deleter()) {}

constexpr Blob& operator=(Blob const& other) {
_CONSTEXPR23 Blob& operator=(Blob const& other) {
if (this != &other) {
*this = Blob{other};
}
Expand Down

0 comments on commit ec83f0a

Please sign in to comment.