register_callback

Registers functions when an event occurs.

  void register_callback
     (event_callback fn,
     int index);
  
Remarks

Registers the pai r (fn, index) such that during calls to imbue(),copyfmt() or ~ios_base() the function fn is called with argument index. Registered functions are called when an event occurs, in opposite order of registration. Functions registered while a callback function is active are not called until the next event.

Identical pairs are not merged and a function registered twice will be called twice.