Skip to content

Commit

Permalink
Fix linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
endurodave committed Dec 30, 2024
1 parent 635902c commit 86c5c07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Examples/Observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class ConcreteObserverB : public Observer {
class Subject {
public:
virtual ~Subject() = default;
virtual void attach(Delegate<void(int)>& observer) = 0;
virtual void detach(Delegate<void(int)>& observer) = 0;
virtual void attach(const Delegate<void(int)>& observer) = 0;
virtual void detach(const Delegate<void(int)>& observer) = 0;
virtual void notify() = 0;
};

Expand All @@ -50,12 +50,12 @@ class ConcreteSubject : public Subject {
ConcreteSubject(int initialState) : state(initialState) {}

// Attach observer
void attach(Delegate<void(int)>& observer) override {
void attach(const Delegate<void(int)>& observer) override {
observers += observer;
}

// Detach observer
void detach(Delegate<void(int)>& observer) override {
void detach(const Delegate<void(int)>& observer) override {
observers -= observer;
}

Expand Down

0 comments on commit 86c5c07

Please sign in to comment.