aboutsummaryrefslogtreecommitdiff
path: root/libs/kstd
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-04-02 13:59:27 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-04-02 14:02:13 +0200
commitb84c4c9d8c90f3d3fd5a60de282278912fad2f04 (patch)
treeac283ed18407a8e97bcd14b2cfca3da74f60547b /libs/kstd
parentd0c532af74d8d486d734904fd330d5dae7f49754 (diff)
downloadteachos-b84c4c9d8c90f3d3fd5a60de282278912fad2f04.tar.xz
teachos-b84c4c9d8c90f3d3fd5a60de282278912fad2f04.zip
x86_64/devices: implement ISA bus stub
Diffstat (limited to 'libs/kstd')
-rw-r--r--libs/kstd/include/kstd/bits/unique_ptr.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/kstd/include/kstd/bits/unique_ptr.hpp b/libs/kstd/include/kstd/bits/unique_ptr.hpp
index e0870b1..f50335c 100644
--- a/libs/kstd/include/kstd/bits/unique_ptr.hpp
+++ b/libs/kstd/include/kstd/bits/unique_ptr.hpp
@@ -16,6 +16,9 @@ namespace kstd
template<typename T>
struct unique_ptr
{
+ template<typename U>
+ friend struct unique_ptr;
+
/**
* @brief Constructor.
*
@@ -40,6 +43,14 @@ namespace kstd
*/
unique_ptr(unique_ptr const &) = delete;
+ template<typename U>
+ requires(std::is_convertible_v<U *, T *>)
+ unique_ptr(unique_ptr<U> && other) noexcept
+ : pointer(other.pointer)
+ {
+ other.pointer = nullptr;
+ }
+
/**
* @brief Deleted copy assignment operator to enforce unique ownership.
*/