This example uses a simple approach to the implementation of the output operator because the main
feature to be exposed is the use of the function iword(). The format flag is considered to be a
Boolean value that defines whether spaces between numerator and denominator should be written.
In the first line, the function ios_base::xalloc() obtains an index that can be used to store
the format flag. The result of this call is stored in a constant because it is never modified. The
function fraction_spaces() is a manipulator that sets the int value that is stored at the index
iword_index in the integer array associated with the stream strm to true. The output operator
retrieves that value and writes the fraction according the value stored. If the value is false, the
default formatting using no spaces is used. Otherwise, spaces are placed around the slash.