UpcastablePointer: introduce copy helper

This commit is contained in:
Ivan Krysak
2024-02-22 08:45:09 +01:00
committed by Alessandro Di Federico
parent efc24dee4b
commit 2dfdff992d
+4
View File
@@ -174,6 +174,10 @@ public:
return UpcastablePointer<T>(new Q(std::forward<Args>(TheArgs)...));
}
UpcastablePointer copy() const {
return UpcastablePointer(clone(Pointer.get()));
}
public:
UpcastablePointer &operator=(const UpcastablePointer &Other) {
if (&Other != this) {