Registers a callback function with the token. If and when the token is canceled, the callback will be made. Note that if the token is already canceled at the point where this method is called, the callback will be made immediately and synchronously.
The type of the function object that will be called back when this cancellation_token is canceled.
The function object that will be called back when this cancellation_token is canceled.
A cancellation_token_registration object which can be utilized in the deregister method to deregister a previously registered callback and prevent it from being made. The method will throw an invalid_operation exception if it is called on a cancellation_token object that was created using the cancellation_token::none method.