diff options
Diffstat (limited to 'kapi/include')
| -rw-r--r-- | kapi/include/kapi/memory/address.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kapi/include/kapi/memory/address.hpp b/kapi/include/kapi/memory/address.hpp index 19615e4..ad82f20 100644 --- a/kapi/include/kapi/memory/address.hpp +++ b/kapi/include/kapi/memory/address.hpp @@ -33,6 +33,17 @@ namespace teachos::memory return std::bit_cast<std::byte *>(m_value); } + constexpr auto operator>>(std::size_t n) const noexcept -> address + { + return address{m_value >> n}; + } + + template<typename MaskType> + constexpr auto operator&(MaskType mask) const noexcept -> MaskType + { + return static_cast<MaskType>(m_value & mask); + } + constexpr auto operator<=>(address const &) const noexcept -> std::strong_ordering = default; constexpr auto operator==(address const &) const noexcept -> bool = default; |
