mirror of https://github.com/AxioDL/metaforce.git
IVParamObj: Explicitly supply copy and move constructor/assingnment operators
Since the copy constructor is provided, we should explicitly specify the others to make behavior explicit (and prevent the copy constructor from being considered over the move constructor in certain scenarios).
This commit is contained in:
parent
541adb02d2
commit
026de44611
|
@ -24,9 +24,15 @@ class CVParamTransfer {
|
||||||
std::shared_ptr<IVParamObj> m_ref;
|
std::shared_ptr<IVParamObj> m_ref;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CVParamTransfer() = default;
|
CVParamTransfer() noexcept = default;
|
||||||
CVParamTransfer(IVParamObj* obj) : m_ref(obj) {}
|
CVParamTransfer(IVParamObj* obj) : m_ref(obj) {}
|
||||||
CVParamTransfer(const CVParamTransfer& other) : m_ref(other.m_ref) {}
|
|
||||||
|
CVParamTransfer(const CVParamTransfer& other) noexcept = default;
|
||||||
|
CVParamTransfer& operator=(const CVParamTransfer&) noexcept = default;
|
||||||
|
|
||||||
|
CVParamTransfer(CVParamTransfer&&) noexcept = default;
|
||||||
|
CVParamTransfer& operator=(CVParamTransfer&&) noexcept = default;
|
||||||
|
|
||||||
IVParamObj* GetObj() const { return m_ref.get(); }
|
IVParamObj* GetObj() const { return m_ref.get(); }
|
||||||
CVParamTransfer ShareTransferRef() const { return CVParamTransfer(*this); }
|
CVParamTransfer ShareTransferRef() const { return CVParamTransfer(*this); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue