Core: One: clone instead of DeepCopyNew

git-svn-id: svn://ultimatepp.org/upp/trunk@12117 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2018-07-29 18:20:34 +00:00
parent 6b713ecc4a
commit 4ea50ca323

View file

@ -66,7 +66,7 @@ public:
One(T *newt) { ptr = newt; }
template <class TT>
One(One<TT>&& p) { Pick(pick(p)); }
One(const One<T>& p, int) { ptr = p.IsEmpty() ? NULL : DeepCopyNew(*p); }
One(const One<T>& p, int) { ptr = p.IsEmpty() ? NULL : new T(clone(*p)); }
One(const One<T>& p) = delete;
void operator=(const One<T>& p) = delete;
~One() { Free(); }