From 994f91c5c5b1a3ab40bc5545070dab96b6ff0098 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 5 Jun 2026 11:34:11 +0200 Subject: fix weird errors For some reason, I can no longer initialize a CallStack instance from an initializer list. On CI, it works fine; maybe my compiler is newer and somehow defaults to a newer standard or something? Idk --- include/winapi/debug/call_stack.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/winapi') diff --git a/include/winapi/debug/call_stack.hpp b/include/winapi/debug/call_stack.hpp index e5b8c41..a9a9d43 100644 --- a/include/winapi/debug/call_stack.hpp +++ b/include/winapi/debug/call_stack.hpp @@ -38,16 +38,21 @@ public: void dump(std::ostream& os, const DbgHelp&) const; - const std::array frames; - const std::size_t length; + std::size_t length() const { return _length; } const Address* begin() const { return frames.data(); } const Address* cbegin() const { return begin(); } - const Address* end() const { return begin() + length; } + const Address* end() const { return begin() + _length; } const Address* cend() const { return end(); } private: CallStack() = default; + + CallStack(std::array&& frames, std::size_t length) + : frames{std::move(frames)}, _length{length} {} + + std::array frames; + std::size_t _length; }; } // namespace winapi -- cgit v1.3