mirror of https://github.com/AxioDL/metaforce.git
IVParamObj: Make rest of interface noexcept where applicable
Allows a few of these member functions to be used within noexcept contexts.
This commit is contained in:
parent
026de44611
commit
cdf6361d6c
|
@ -16,8 +16,8 @@ class TObjOwnerParam : public IVParamObj {
|
|||
|
||||
public:
|
||||
TObjOwnerParam(T&& obj) : m_param(std::move(obj)) {}
|
||||
T& GetParam() { return m_param; }
|
||||
const T& GetParam() const { return m_param; }
|
||||
T& GetParam() noexcept { return m_param; }
|
||||
const T& GetParam() const noexcept { return m_param; }
|
||||
};
|
||||
|
||||
class CVParamTransfer {
|
||||
|
@ -33,15 +33,15 @@ public:
|
|||
CVParamTransfer(CVParamTransfer&&) noexcept = default;
|
||||
CVParamTransfer& operator=(CVParamTransfer&&) noexcept = default;
|
||||
|
||||
IVParamObj* GetObj() const { return m_ref.get(); }
|
||||
CVParamTransfer ShareTransferRef() const { return CVParamTransfer(*this); }
|
||||
IVParamObj* GetObj() const noexcept { return m_ref.get(); }
|
||||
CVParamTransfer ShareTransferRef() const noexcept { return CVParamTransfer(*this); }
|
||||
|
||||
template <class T>
|
||||
T& GetOwnedObj() const {
|
||||
T& GetOwnedObj() const noexcept {
|
||||
return static_cast<TObjOwnerParam<T>*>(GetObj())->GetParam();
|
||||
}
|
||||
|
||||
static CVParamTransfer Null() { return CVParamTransfer(); }
|
||||
static CVParamTransfer Null() noexcept { return CVParamTransfer(); }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
|
|
Loading…
Reference in New Issue