I'm using register_callback()
to register a call-back function for iostreams as described in
Standard C++ IOStreams and Locales, p. 202.
However, neither it nor any documentation I could find say how one can unregister a call-back. Is it possible? If I were to zero-out the iword/pword I'm using, is unregistering even necessary?
The register_callback function registers your callback for a specific stream object. The way to get rid of the registration is to let the stream go out of scope.
If you need your callback to do its work for just a part of the stream's lifetime, you can store that condition with the callback and make it do nothing.
Clearing iword/pword doesn't help (except that it could be a signal to the callback to do nothing), and there is no way to unregister.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With