diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-11-12 23:57:50 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-11-22 14:20:35 +0100 |
| commit | 1cd8cd46eb330319d3c615601358a4406ce89de8 (patch) | |
| tree | 0ae68a5b64a705904a75b68bd29aa03bdc81a0da /libs | |
| parent | 27a58a338ad2f61a063df02488fc497405afc492 (diff) | |
| download | kernel-1cd8cd46eb330319d3c615601358a4406ce89de8.tar.xz kernel-1cd8cd46eb330319d3c615601358a4406ce89de8.zip | |
dev/pcie: implement basic enumeration algorithm
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/kstd/kstd/bits/observer_ptr.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/kstd/kstd/bits/observer_ptr.hpp b/libs/kstd/kstd/bits/observer_ptr.hpp index 753cfcb7..31162716 100644 --- a/libs/kstd/kstd/bits/observer_ptr.hpp +++ b/libs/kstd/kstd/bits/observer_ptr.hpp @@ -118,6 +118,15 @@ namespace kstd return m_ptr; } + //! Advance the observer pointer by a given offset. + //! + //! @param offset The number of elements to advance the pointer by. + //! @return The advanced observer pointer. + constexpr auto friend operator+(observer_ptr const & ptr, std::ptrdiff_t offset) noexcept -> observer_ptr + { + return observer_ptr{ptr.m_ptr + offset}; + } + //! Compare the observer pointer with another observer pointer. //!> //! @param other The other observer pointer to compare with. |
