Skip to content

Commit

Permalink
Fixed|libdeng2|Observers: Added missing const += by-ref operator
Browse files Browse the repository at this point in the history
There was a corresponding const method for insertion by pointer, but
no by reference.
  • Loading branch information
skyjake committed Aug 19, 2013
1 parent ba1a0e1 commit 24d9997
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doomsday/client/src/world/world.cpp
Expand Up @@ -859,7 +859,7 @@ Hand &World::hand(coord_t *distance) const
if(d->hand.isNull())
{
d->hand.reset(new Hand());
const_cast<World *>(this)->audienceForFrameEnd += *d->hand;
audienceForFrameEnd += *d->hand;
if(d->map)
{
d->updateHandOrigin();
Expand Down
5 changes: 5 additions & 0 deletions doomsday/libdeng2/include/de/data/observers.h
Expand Up @@ -217,6 +217,11 @@ class Observers : public Lockable
return *this;
}

Observers<Type> const &operator += (Type &observer) const {
const_cast<Observers<Type> *>(this)->add(&observer);
return *this;
}

void remove(Type *observer) {
DENG2_GUARD(this);
_members.remove(observer);
Expand Down

0 comments on commit 24d9997

Please sign in to comment.