mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-03 08:46:19 +08:00
Added default constructors for Ref and Box
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user