Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>> I would have to create a base class for every unique type of the callback and then for every caller possibly a new class deriving.

An interface declaration is, like, two lines. And a single receiver can implement multiple interfaces. In exchange, the debugger gets a lot more useful. Plus it ensures the lifetime of the "callback" and the "context" are tightly-coupled, so you don't have to worry about intersecting use-after-frees.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: