Description
removeLinkListener, removeAddressListener and removeRouteListener use target_type() / target() to find the callback to remove.
This only works with raw function pointers — lambdas and std::bind expressions each have a unique type and will never match, making removal silently ineffective.
Possible solution
Return an opaque ID from addListener() and accept that ID in removeListener():
auto id = manager.addLinkListener([](const LinkInfo& info) { ... });
manager.removeLinkListener(id);
Acceptance criteria
- Raw function pointers, std::bind expressions, and lambdas can all be removed via remove*Listener()
- Applies to LinkListener, AddressListener, and RouteListener
Description
removeLinkListener, removeAddressListener and removeRouteListener use target_type() / target() to find the callback to remove.
This only works with raw function pointers — lambdas and std::bind expressions each have a unique type and will never match, making removal silently ineffective.
Possible solution
Return an opaque ID from addListener() and accept that ID in removeListener():
Acceptance criteria