|
|
|
|
|
by mwkaufma
250 days ago
|
|
>> Can you elaborate on your third point? What would a class need to do to affect debugging info? Common implementations are a function pointer + void* pair, which in most debuggers just show you two opaque addresses. Better to include a info block -- at least in debug builds -- with polymorphic type pointers that can actually deduce the type and show you all the fields of the receiver. >> sometimes an architecture can be vastly simplified if the source of information can abstracted away. "sometimes" is doing a lot of heavy lifting here. That's my whole point -- more often than not I see some type of homespun functor used in cases that are _not_ simplified, but actually complicated by the unnecessary "plumbing." >> RAII and architecture primarily address this If the receiver uses RAII to clean up the callback, then you've reintroduced the "type-intrusiveness" that functors are meant to avoid...? |
|
This has not been my experience. But I haven't needed to deal with RTTI disabled.
By RAII, I mean using destructors to unregister a callback. This covers 99.9% of use cases. Generally callback registration is not where you really want type erasure anyways.