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:
Lioncash 2019-09-30 02:52:52 -04:00
parent 026de44611
commit cdf6361d6c
1 changed files with 6 additions and 6 deletions

View File

@ -16,8 +16,8 @@ class TObjOwnerParam : public IVParamObj {
public: public:
TObjOwnerParam(T&& obj) : m_param(std::move(obj)) {} TObjOwnerParam(T&& obj) : m_param(std::move(obj)) {}
T& GetParam() { return m_param; } T& GetParam() noexcept { return m_param; }
const T& GetParam() const { return m_param; } const T& GetParam() const noexcept { return m_param; }
}; };
class CVParamTransfer { class CVParamTransfer {
@ -33,15 +33,15 @@ public:
CVParamTransfer(CVParamTransfer&&) noexcept = default; CVParamTransfer(CVParamTransfer&&) noexcept = default;
CVParamTransfer& operator=(CVParamTransfer&&) noexcept = default; CVParamTransfer& operator=(CVParamTransfer&&) noexcept = default;
IVParamObj* GetObj() const { return m_ref.get(); } IVParamObj* GetObj() const noexcept { return m_ref.get(); }
CVParamTransfer ShareTransferRef() const { return CVParamTransfer(*this); } CVParamTransfer ShareTransferRef() const noexcept { return CVParamTransfer(*this); }
template <class T> template <class T>
T& GetOwnedObj() const { T& GetOwnedObj() const noexcept {
return static_cast<TObjOwnerParam<T>*>(GetObj())->GetParam(); return static_cast<TObjOwnerParam<T>*>(GetObj())->GetParam();
} }
static CVParamTransfer Null() { return CVParamTransfer(); } static CVParamTransfer Null() noexcept { return CVParamTransfer(); }
}; };
} // namespace urde } // namespace urde