Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I know C++ only barely so i'll comment instead of answering. AFAICT you can implement Pub/Sub (callbacks) with interfaces as well. Thats the way things work in the Java, C# and JS universes. EDIT: some examples: developer.android.com/reference/android/view/… docs.oracle.com/javase/8/docs/api/java/awt/event/…
    – marstato
    Commented Dec 15, 2016 at 11:13
  • I don't understand: why test if (instance->hasEventCompleted)? There can be no instance that hasn't overridden the abstract method, no?
    – Erik Eidt
    Commented Dec 15, 2016 at 15:41
  • I completed the example now. I have been thinking a little bit too long about it and thought my example code would be fine but in fact I was thinking too far. Commented Dec 15, 2016 at 16:44
  • I completed the example now. I have been thinking a little bit too long about it and thought my example code would be fine but in fact I was thinking too far. I don't know a lot about Java, but I'm not aware of any C++11 features or any libraries which would allow for a similar functionality to Java. Commented Dec 15, 2016 at 16:47