diff --git a/src/libs/karm-base/opt.h b/src/libs/karm-base/opt.h index f473c726de..c3e1bfee80 100644 --- a/src/libs/karm-base/opt.h +++ b/src/libs/karm-base/opt.h @@ -141,28 +141,28 @@ struct [[nodiscard]] Opt { return _present; } - always_inline constexpr T *operator->() { + always_inline constexpr T *operator->() lifetimebound { if (not _present) [[unlikely]] panic("unwrapping None"); return &_value; } - always_inline constexpr T &operator*() { + always_inline constexpr T &operator*() lifetimebound { if (not _present) [[unlikely]] panic("unwrapping None"); return _value; } - always_inline constexpr T const *operator->() const { + always_inline constexpr T const *operator->() const lifetimebound { if (not _present) [[unlikely]] panic("unwrapping None"); return &_value; } - always_inline constexpr T const &operator*() const { + always_inline constexpr T const &operator*() const lifetimebound { if (not _present) [[unlikely]] panic("unwrapping None"); @@ -170,7 +170,7 @@ struct [[nodiscard]] Opt { } template - always_inline constexpr T &emplace(Args &&...args) { + always_inline constexpr T &emplace(Args &&...args) lifetimebound { clear(); _present = true; std::construct_at(&_value, std::forward(args)...); @@ -188,31 +188,31 @@ struct [[nodiscard]] Opt { return NONE; } - always_inline constexpr T &unwrap(char const *msg = "unwraping none") { + always_inline constexpr T &unwrap(char const *msg = "unwraping none") lifetimebound { if (not _present) [[unlikely]] panic(msg); return _value; } - always_inline constexpr T const &unwrap(char const *msg = "unwraping none") const { + always_inline constexpr T const &unwrap(char const *msg = "unwraping none") const lifetimebound { if (not _present) [[unlikely]] panic(msg); return _value; } - always_inline constexpr T const &unwrapOr(T const &other) const { + always_inline constexpr T const &unwrapOr(T const &other) const lifetimebound { if (_present) return _value; return other; } - always_inline constexpr T unwrapOrDefault(T other) const { + always_inline constexpr T unwrapOrDefault(T other) const lifetimebound { if (_present) return _value; return other; } - always_inline constexpr T unwrapOrElse(auto f) const { + always_inline constexpr T unwrapOrElse(auto f) const lifetimebound { if (_present) return _value; return f(); diff --git a/src/libs/karm-base/res.h b/src/libs/karm-base/res.h index 1ea6dcdecc..d945c6f390 100644 --- a/src/libs/karm-base/res.h +++ b/src/libs/karm-base/res.h @@ -63,28 +63,28 @@ struct [[nodiscard]] Res { return _inner.template is>(); } - always_inline constexpr E const &none() const { + always_inline constexpr E const &none() const lifetimebound { if (not _inner.template is()) [[unlikely]] panic("none() called on an ok"); return _inner.template unwrap(); } - always_inline constexpr V &unwrap(char const *msg = "unwraping an error") { + always_inline constexpr V &unwrap(char const *msg = "unwraping an error") lifetimebound { if (not _inner.template is>()) [[unlikely]] panic(msg); return _inner.template unwrap>().inner; } - always_inline constexpr V const &unwrap(char const *msg = "unwraping an error") const { + always_inline constexpr V const &unwrap(char const *msg = "unwraping an error") const lifetimebound { if (not _inner.template is>()) [[unlikely]] panic(msg); return _inner.template unwrap>().inner; } - always_inline constexpr V const &unwrapOr(V const &other) const { + always_inline constexpr V const &unwrapOr(V const &other) const lifetimebound { if (_inner.template is>()) return _inner.template unwrap>().inner; return other; diff --git a/src/libs/karm-io/impls.h b/src/libs/karm-io/impls.h index 5fed230392..b88ea3a1ce 100644 --- a/src/libs/karm-io/impls.h +++ b/src/libs/karm-io/impls.h @@ -124,9 +124,9 @@ struct BufWriter : public Seeker { MutBytes _buf; - usize _pos; + usize _pos = 0; - BufWriter(MutBytes buf) : _buf(buf), _pos(0) {} + BufWriter(MutBytes buf) : _buf(buf) {} Res seek(Seek seek) override { _pos = seek.apply(_pos, sizeOf(_buf));