File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -41,14 +41,17 @@ void example() {
4141 eventB.emit("meaning of life", 42);
4242
4343 // ` observe::Observer ` can store any type of observer
44+ // previous observers will be removed
4445 observer.observe(eventA, [ ] ( ) { std::cout << "I am now observing A" << std::endl; });
4546
4647 // to remove an observer without destroying the object, call reset
4748 observer.reset();
4849}
4950```
5051
51- Note that events and observers are thread and exception safe, though any thrown exception will propagate out of the ` event.emit() ` call.
52+ Note that events and observers are thread and exception safe, as long as the handlers manage their own resources.
53+ Handlers can safely remove observers (including themselves) from the event when beeing called.
54+ Thrown exceptions will propagate out of the ` event.emit() ` call.
5255
5356### Using observe::Value
5457
You can’t perform that action at this time.
0 commit comments