diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-05 11:34:11 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-05 11:34:11 +0200 |
| commit | 994f91c5c5b1a3ab40bc5545070dab96b6ff0098 (patch) | |
| tree | 4ee7f0ee0fec8c1841bf4d5f30093cb85568ec7a /include | |
| parent | fix .clang-tidy (diff) | |
| download | winapi-debug-994f91c5c5b1a3ab40bc5545070dab96b6ff0098.tar.gz winapi-debug-994f91c5c5b1a3ab40bc5545070dab96b6ff0098.zip | |
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
Diffstat (limited to 'include')
| -rw-r--r-- | include/winapi/debug/call_stack.hpp | 11 |
1 files changed, 8 insertions, 3 deletions
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<Address, max_length> 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<Address, max_length>&& frames, std::size_t length) + : frames{std::move(frames)}, _length{length} {} + + std::array<Address, max_length> frames; + std::size_t _length; }; } // namespace winapi |
