Added default constructors for Ref and Box

This commit is contained in:
Patrick Urbanke
2023-10-22 18:29:37 +02:00
parent fe1b2d141e
commit 32bc4fd075
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -18,6 +18,8 @@ class Box {
return Box<T>(std::make_unique<T>(std::forward<Args>(_args)...));
}
Box() : ptr_(std::make_unique<T>()) {}
Box(const Box<T>& _other) = delete;
Box(Box<T>&& _other) = default;
+2
View File
@@ -18,6 +18,8 @@ class Ref {
return Ref<T>(std::make_shared<T>(std::forward<Args>(_args)...));
}
Ref() : ptr_(std::make_shared<T>()) {}
Ref(const Ref<T>& _other) = default;
Ref(Ref<T>&& _other) = default;