add noexcept specifier to Observer::Notify() methods
This commit is contained in:
parent
7663ed9dea
commit
03981f2cd9
@ -20,9 +20,9 @@ class Observer {
|
||||
inline virtual ~Observer() noexcept;
|
||||
|
||||
protected:
|
||||
virtual void Notify(const T&) {}
|
||||
virtual void NotifyWithMove(T&& v) { Notify(v); }
|
||||
virtual void NotifyDestruction(const T* = nullptr) {}
|
||||
virtual void Notify(const T&) noexcept {}
|
||||
virtual void NotifyWithMove(T&& v) noexcept { Notify(v); }
|
||||
virtual void NotifyDestruction(const T* = nullptr) noexcept {}
|
||||
|
||||
private:
|
||||
Target& target_;
|
||||
|
@ -14,9 +14,9 @@ class ObserverMock : public Observer<T> {
|
||||
explicit ObserverMock(Observer<T>::Target& target) : Observer<T>(target) {
|
||||
}
|
||||
|
||||
MOCK_METHOD(void, Notify, (const T&));
|
||||
MOCK_METHOD(void, NotifyWithMove, (T&&));
|
||||
MOCK_METHOD(void, NotifyDestruction, (const T*));
|
||||
MOCK_METHOD(void, Notify, (const T&), (noexcept, override));
|
||||
MOCK_METHOD(void, NotifyWithMove, (T&&), (noexcept, override));
|
||||
MOCK_METHOD(void, NotifyDestruction, (const T*), (noexcept, override));
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
Loading…
x
Reference in New Issue
Block a user