[ios.base.callback] (original) (raw)

31 Input/output library [input.output]

31.5 Iostreams base classes [iostreams.base]

31.5.2 Class ios_base [ios.base]

31.5.2.7 Callbacks [ios.base.callback]

void register_callback(event_callback fn, int idx);

Preconditions: The functionfndoes not throw exceptions.

Effects: Registers the pair(fn, idx)such that during calls toimbue() ([ios.base.locales]),copyfmt(), or~ios_base() ([ios.base.cons]), the functionfnis called with argumentidx.

Functions registered 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.

Remarks: Identical pairs are not merged.

A function registered twice will be called twice.