Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-1025

Documentation for ios_base::flags and ios_base::setf misleading

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.2.1
    • 4.2.2
    • Documentation
    • None
    • Usability

    Description

      The documentation says for boths "flags(fmtflags fmtfl)" and "setf(fmtflags fmtfl)" exactly the same, which is not true:

      flags(fmtflags fmtfl);
      Saves the format control information, then sets it to fmtfl and returns the previously saved value.

      setf(fmtflags fmtfl);
      Saves the format control information, then sets it to fmtfl and returns the previously saved value.

      The documentation in the header file "ios_base.h" is indeed better. It states for flags:
      > This function overwrites all the format flags with @a fmtfl.
      while for setf it says:
      > This function sets additional flags in format control. Flags that were previously set remain set.

      BTW: The start of the sentences "Saves the format control information..." is confusing anyway and not necessary for anyone using this interface. It's enough to know that the function "returns the previously saved value".

      Attachments

        Activity

          People

            sebor Martin Sebor
            ezander Elmar Zander
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h