[iostreams.base] (original) (raw)

31.5.2 Class ios_base [ios.base]

31.5.2.1 General [ios.base.general]

namespace std { class ios_base { public: class failure; using fmtflags = T1;static constexpr fmtflags boolalpha = unspecified;static constexpr fmtflags dec = unspecified;static constexpr fmtflags fixed = unspecified;static constexpr fmtflags hex = unspecified;static constexpr fmtflags internal = unspecified;static constexpr fmtflags left = unspecified;static constexpr fmtflags oct = unspecified;static constexpr fmtflags right = unspecified;static constexpr fmtflags scientific = unspecified;static constexpr fmtflags showbase = unspecified;static constexpr fmtflags showpoint = unspecified;static constexpr fmtflags showpos = unspecified;static constexpr fmtflags skipws = unspecified;static constexpr fmtflags unitbuf = unspecified;static constexpr fmtflags uppercase = unspecified;static constexpr fmtflags adjustfield = see below;static constexpr fmtflags basefield = see below;static constexpr fmtflags floatfield = see below;using iostate = T2;static constexpr iostate badbit = unspecified;static constexpr iostate eofbit = unspecified;static constexpr iostate failbit = unspecified;static constexpr iostate goodbit = see below;using openmode = T3;static constexpr openmode app = unspecified;static constexpr openmode ate = unspecified;static constexpr openmode binary = unspecified;static constexpr openmode in = unspecified;static constexpr openmode noreplace = unspecified;static constexpr openmode out = unspecified;static constexpr openmode trunc = unspecified;using seekdir = T4;static constexpr seekdir beg = unspecified;static constexpr seekdir cur = unspecified;static constexpr seekdir end = unspecified;class Init; fmtflags flags() const; fmtflags flags(fmtflags fmtfl); fmtflags setf(fmtflags fmtfl); fmtflags setf(fmtflags fmtfl, fmtflags mask);void unsetf(fmtflags mask); streamsize precision() const; streamsize precision(streamsize prec); streamsize width() const; streamsize width(streamsize wide); locale imbue(const locale& loc); locale getloc() const;static int xalloc();long& iword(int idx);void*& pword(int idx);virtual ~ios_base();enum event { erase_event, imbue_event, copyfmt_event };using event_callback = void (*)(event, ios_base&, int idx);void register_callback(event_callback fn, int idx); ios_base(const ios_base&) = delete; ios_base& operator=(const ios_base&) = delete;static bool sync_with_stdio(bool sync = true);protected: ios_base();private: static int index; long* iarray; void** parray; };}

ios_basedefines several member types:

It maintains several kinds of data:

[Note 1:

For the sake of exposition, the maintained data is presented here as:

— _end note_]

31.5.2.2 Types [ios.types]

31.5.2.2.1 Class ios_base​::​failure [ios.failure]

namespace std { class ios_base::failure : public system_error { public: explicit failure(const string& msg, const error_code& ec = io_errc::stream);explicit failure(const char* msg, const error_code& ec = io_errc::stream);};}

An implementation is permitted to define ios_base​::​failureas a synonym for a class with equivalent functionality to class ios_base​::​failure shown in this subclause.

[Note 1:

When ios_base​::​failure is a synonym for another type, that type needs to provide a nested type failureto emulate the injected-class-name.

— _end note_]

The classfailuredefines the base class for the types of all objects thrown as exceptions, by functions in the iostreams library, to report errors detected during stream buffer operations.

When throwing ios_base​::​failure exceptions, implementations should provide values of ec that identify the specific reason for the failure.

[Note 2:

Errors arising from the operating system would typically be reported assystem_category() errors with an error value of the error number reported by the operating system.

Errors arising from within the stream library would typically be reported as error_code(io_errc​::​stream, iostream_category()).

— _end note_]

explicit failure(const string& msg, const error_code& ec = io_errc::stream);

Effects: Constructs the base class with msg and ec.

explicit failure(const char* msg, const error_code& ec = io_errc::stream);

Effects: Constructs the base class with msg and ec.

31.5.2.2.2 Type ios_base​::​fmtflags [ios.fmtflags]

Setting its elements has the effects indicated in Table 134.

Table 134 — fmtflags effects [tab:ios.fmtflags]

🔗Element Effect(s) if set
🔗boolalpha insert and extract bool type in alphabetic format
🔗dec converts integer input or generates integer output in decimal base
🔗fixed generate floating-point output in fixed-point notation
🔗hex converts integer input or generates integer output in hexadecimal base
🔗internal adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated
🔗left adds fill characters on the right (final positions) of certain generated output
🔗oct converts integer input or generates integer output in octal base
🔗right adds fill characters on the left (initial positions) of certain generated output
🔗scientific generates floating-point output in scientific notation
🔗showbase generates a prefix indicating the numeric base of generated integer output
🔗showpoint generates a decimal-point character unconditionally in generated floating-point output
🔗showpos generates a + sign in non-negative generated numeric output
🔗skipws skips leading whitespace before certain input operations
🔗unitbuf flushes output after each output operation
🔗uppercase replaces certain lowercase letters with their uppercase equivalents in generated output

Typefmtflagsalso defines the constants indicated in Table 135.

31.5.2.2.3 Type ios_base​::​iostate [ios.iostate]

The typeiostateis a bitmask type ([bitmask.types]) that contains the elements indicated in Table 136.

Table 136 — iostate effects [tab:ios.iostate]

indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file);
indicates that an input operation reached the end of an input sequence;
indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters.

Typeiostatealso defines the constant:

31.5.2.2.4 Type ios_base​::​openmode [ios.openmode]

It contains the elements indicated in Table 137.

Table 137 — openmode effects [tab:ios.openmode]

🔗Element Effect(s) if set
🔗app seek to end before each write
🔗ate open and seek to end immediately after opening
🔗binary perform input and output in binary mode (as opposed to text mode)
🔗in open for input
🔗noreplace open in exclusive mode
🔗out open for output
🔗trunc truncate an existing stream when opening

31.5.2.2.5 Type ios_base​::​seekdir [ios.seekdir]

The typeseekdiris an enumerated type ([enumerated.types]) that contains the elements indicated in Table 138.

Table 138 — seekdir effects [tab:ios.seekdir]

request a seek (for subsequent input or output) relative to the beginning of the stream
request a seek relative to the current position within the sequence
request a seek relative to the current end of the sequence

31.5.2.2.6 Class ios_base​::​Init [ios.init]

namespace std { class ios_base::Init { public: Init(); Init(const Init&) = default;~Init(); Init& operator=(const Init&) = default;};}

The class Initdescribes an object whose construction ensures the construction of the eight objects declared in ([iostream.objects]) that associate file stream buffers with the standard C streams provided for by the functions declared in.

Effects: Constructs and initializes the objects cin, cout, cerr,clog, wcin, wcout, wcerr, and wclog if they have not already been constructed and initialized.

Effects: If there are no other instances of the class still in existence, callscout.flush(),cerr.flush(),clog.flush(),wcout.flush(),wcerr.flush(),wclog.flush().

31.5.2.3 State functions [fmtflags.state]

Returns: The format control information for both input and output.

fmtflags flags(fmtflags fmtfl);

Postconditions: fmtfl == flags().

Returns: The previous value offlags().

fmtflags setf(fmtflags fmtfl);

Effects: Sets fmtfl inflags().

Returns: The previous value offlags().

fmtflags setf(fmtflags fmtfl, fmtflags mask);

Effects: Clears mask inflags(), setsfmtfl & maskinflags().

Returns: The previous value offlags().

void unsetf(fmtflags mask);

Effects: Clears mask inflags().

streamsize precision() const;

Returns: The precision to generate on certain output conversions.

streamsize precision(streamsize prec);

Postconditions: prec == precision().

Returns: The previous value ofprecision().

streamsize width() const;

Returns: The minimum field width (number of characters) to generate on certain output conversions.

streamsize width(streamsize wide);

Postconditions: wide == width().

Returns: The previous value ofwidth().

31.5.2.4 Functions [ios.base.locales]

locale imbue(const locale& loc);

Effects: Calls each registered callback pair(fn, idx) ([ios.base.callback]) as(*fn)(imbue_event, *this, idx)at such a time that a call toios_base​::​getloc()from withinfnreturns the new locale valueloc.

Postconditions: loc == getloc().

Returns: The previous value ofgetloc().

Returns: If no locale has been imbued, a copy of the global C++ locale,locale(), in effect at the time of construction.

Otherwise, returns the imbued locale, to be used to perform locale-dependent input and output operations.

31.5.2.5 Static members [ios.members.static]

static bool sync_with_stdio(bool sync = true);

Effects: If any input or output operation has occurred using the standard streams prior to the call, the effect isimplementation-defined.

Otherwise, called with a false argument, it allows the standard streams to operate independently of the standard C streams.

Returns: trueif the previous state of the standard iostream objectswas synchronized and otherwise returnsfalse.

The first time it is called, the function returnstrue.

Remarks: When a standard iostream object str is_synchronized_with a standard stdio stream f, the effect of inserting a character c byfputc(f, c);is the same as the effect ofstr.rdbuf()->sputc(c);for any sequences of characters; the effect of extracting a character c byc = fgetc(f);is the same as the effect ofc = str.rdbuf()->sbumpc();for any sequences of characters; and the effect of pushing back a character c byungetc(c, f);is the same as the effect ofstr.rdbuf()->sputbackc(c);for any sequence of characters.260

31.5.2.6 Storage functions [ios.base.storage]

Remarks: Concurrent access to this function by multiple threads does not result in adata race.

Preconditions: idx is a value obtained by a call to xalloc.

Effects: If iarray is a null pointer, allocates an array oflongof unspecified size and stores a pointer to its first element in_iarray_.

The function then extends the array pointed at by_iarray_ as necessary to include the element_iarray_[idx].

Each newly allocated element of the array is initialized to zero.

The reference returned is invalid after any other operation on the object.261

However, the value of the storage referred to is retained, so that until the next call tocopyfmt, callingiwordwith the same index yields another reference to the same value.

If the function fails262and*thisis a base class subobject of abasic_ios<>object or subobject, the effect is equivalent to callingbasic_ios<>​::​setstate(badbit)on the derived object (which may throwfailure).

Returns: On success_iarray_[idx].

On failure, a validlong&initialized to 0.

Preconditions: idx is a value obtained by a call to xalloc.

Effects: If parray is a null pointer, allocates an array of pointers to void of unspecified size and stores a pointer to its first element in parray.

The function then extends the array pointed at by parray as necessary to include the element_parray_[idx].

Each newly allocated element of the array is initialized to a null pointer.

The reference returned is invalid after any other operation on the object.

However, the value of the storage referred to is retained, so that until the next call tocopyfmt, callingpwordwith the same index yields another reference to the same value.

If the function fails263and*thisis a base class subobject of abasic_ios<>object or subobject, the effect is equivalent to callingbasic_ios<>​::​setstate(badbit)on the derived object (which may throwfailure).

Returns: On successparray[idx].

On failure a validvoid*&initialized to 0.

Remarks: After a subsequent call topword(int)for the same object, the earlier return value may no longer be valid.

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.

31.5.2.8 Constructors and destructor [ios.base.cons]

Effects: Eachios_basemember has an indeterminate value after construction.

The object's members shall be initialized by callingbasic_ios​::​initbefore the object's first use or before it is destroyed, whichever comes first; otherwise the behavior is undefined.

Effects: Calls each registered callback pair(fn, idx) ([ios.base.callback]) as(*fn)(​erase_event, *this, idx)at such time that anyios_basemember function called from withinfnhas well-defined results.

Then, any memory obtained is deallocated.

31.5.3 Class template fpos [fpos]

31.5.3.1 General [fpos.general]

namespace std { template<class stateT> class fpos { public: stateT state() const;void state(stateT);private: stateT st; };}

31.5.3.2 Members [fpos.members]

Effects: Assigns s to st.

Returns: Current value of st.

31.5.3.3 Requirements [fpos.operations]

An fpos type specifies file position information.

It holds a state object whose type is equal to the template parameter stateT.

If is_trivially_copy_constructible_v<stateT> is true, then fpos<stateT> has a trivial copy constructor.

If is_trivially_copy_assignable_v<stateT> is true, then fpos<stateT> has a trivial copy assignment operator.

If is_trivially_destructible_v<stateT> is true, then fpos<stateT> has a trivial destructor.

In addition, the expressions shown in Table 139are valid and have the indicated semantics.

In that table,

Table 139 — Position type requirements [tab:fpos.operations]

🔗Expression Return type Operational Assertion/note
🔗 semantics pre-/post-condition
🔗P(o) P converts from offset Effects: Value-initializes the state object.
🔗P p(o);P p = o; Effects: Value-initializes the state object. Postconditions: p == P(o) is true.
🔗P() P P(0)
🔗P p; P p(0);
🔗O(p) streamoff converts to offset P(O(p)) == p
🔗p == q bool Remarks: For any two values o and o2, if p is obtained from o converted to P or from a copy of such P value and if q is obtained from o2 converted to P or from a copy of such P value, then p == q is true only if o == o2 is true.
🔗p != q bool !(p == q)
🔗p + o P + offset Remarks: With ql = p + o;, then: ql - o == p
🔗pl += o P& += offset Remarks: With ql = pl; before the +=, then:pl - o == ql
🔗p - o P - offset Remarks: With ql = p - o;, then: ql + o == p
🔗pl -= o P& -= offset Remarks: With ql = pl; before the -=, then:pl + o == ql
🔗o + p convertible to P p + o P(o + p) == p + o
🔗p - q streamoff distance p == q + (p - q)

Stream operations that return a value of typetraits​::​pos_typereturnP(O(-1))as an invalid value to signal an error.

If this value is used as an argument to anyistream,ostream, orstreambuf member that accepts a value of typetraits​::​pos_typethen the behavior of that function is undefined.

31.5.4 Class template basic_ios [ios]

31.5.4.1 Overview [ios.overview]

namespace std { template<class charT, class traits = char_traits<charT>> class basic_ios : public ios_base { public: using char_type = charT;using int_type = typename traits::int_type;using pos_type = typename traits::pos_type;using off_type = typename traits::off_type;using traits_type = traits;explicit operator bool() const;bool operator!() const; iostate rdstate() const;void clear(iostate state = goodbit);void setstate(iostate state);bool good() const;bool eof() const;bool fail() const;bool bad() const; iostate exceptions() const;void exceptions(iostate except);explicit basic_ios(basic_streambuf<charT, traits>* sb);virtual ~basic_ios(); basic_ostream<charT, traits>* tie() const; basic_ostream<charT, traits>* tie(basic_ostream<charT, traits>* tiestr); basic_streambuf<charT, traits>* rdbuf() const; basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb); basic_ios& copyfmt(const basic_ios& rhs); char_type fill() const; char_type fill(char_type ch); locale imbue(const locale& loc);char narrow(char_type c, char dfault) const; char_type widen(char c) const; basic_ios(const basic_ios&) = delete; basic_ios& operator=(const basic_ios&) = delete;protected: basic_ios();void init(basic_streambuf<charT, traits>* sb);void move(basic_ios& rhs);void move(basic_ios&& rhs);void swap(basic_ios& rhs) noexcept;void set_rdbuf(basic_streambuf<charT, traits>* sb);};}

31.5.4.2 Constructors [basic.ios.cons]

explicit basic_ios(basic_streambuf<charT, traits>* sb);

Effects: Assigns initial values to its member objects by callinginit(sb).

Effects: Leaves its member objects uninitialized.

The object shall be initialized by callingbasic_ios​::​initbefore its first use or before it is destroyed, whichever comes first; otherwise the behavior is undefined.

Remarks: The destructor does not destroyrdbuf().

void init(basic_streambuf<charT, traits>* sb);

Postconditions: The postconditions of this function are indicated in Table 140.

Table 140 — basic_ios​::​init() effects [tab:basic.ios.cons]

🔗Element Value
🔗rdbuf() sb
🔗tie() 0
🔗rdstate() goodbit if sb is not a null pointer, otherwise badbit.
🔗exceptions() goodbit
🔗flags() skipws | dec
🔗width() 0
🔗precision() 6
🔗fill() widen(' ')
🔗getloc() a copy of the value returned by locale()
🔗iarray a null pointer
🔗parray a null pointer

31.5.4.3 Member functions [basic.ios.members]

basic_ostream<charT, traits>* tie() const;

Returns: An output sequence that is_tied_to (synchronized with) the sequence controlled by the stream buffer.

basic_ostream<charT, traits>* tie(basic_ostream<charT, traits>* tiestr);

Preconditions: If tiestr is not null, tiestr is not reachable by traversing the linked list of tied stream objects starting fromtiestr->tie().

Postconditions: tiestr == tie().

Returns: The previous value oftie().

basic_streambuf<charT, traits>* rdbuf() const;

Returns: A pointer to thestreambufassociated with the stream.

basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb);

Postconditions: sb == rdbuf().

Returns: The previous value ofrdbuf().

locale imbue(const locale& loc);

Effects: Callsios_base​::​imbue(loc)and ifrdbuf() != 0thenrdbuf()->pubimbue(loc).

Returns: The prior value ofios_base​::​imbue().

char narrow(char_type c, char dfault) const;

Returns: use_facet<ctype<char_type>>(getloc()).narrow(c, dfault)

char_type widen(char c) const;

Returns: use_facet<ctype<char_type>>(getloc()).widen(c)

Returns: The character used to pad (fill) an output conversion to the specified field width.

char_type fill(char_type fillch);

Postconditions: traits​::​eq(fillch, fill()).

Returns: The previous value offill().

basic_ios& copyfmt(const basic_ios& rhs);

Effects: If(this == addressof(rhs)) is truedoes nothing.

Otherwise assigns to the member objects of*thisthe corresponding member objects of rhs as follows:

[Note 1:

The second pass through the callback pairs permits a copied pwordvalue to be zeroed, or to have its referent deep copied or reference counted, or to have other special action taken.

— _end note_]

Postconditions: The postconditions of this function are indicated in Table 141.

Table 141 — basic_ios​::​copyfmt() effects [tab:basic.ios.copyfmt]

🔗Element Value
🔗rdbuf() unchanged
🔗tie() rhs.tie()
🔗rdstate() unchanged
🔗exceptions() rhs.exceptions()
🔗flags() rhs.flags()
🔗width() rhs.width()
🔗precision() rhs.precision()
🔗fill() rhs.fill()
🔗getloc() rhs.getloc()

void move(basic_ios& rhs);void move(basic_ios&& rhs);

Postconditions: *this has the state thatrhs had before the function call, except thatrdbuf() returns nullptr.

rhs is in a valid but unspecified state, except that rhs.rdbuf() returns the same value as it returned before the function call, andrhs.tie() returns nullptr.

void swap(basic_ios& rhs) noexcept;

Effects: The states of *this and rhsare exchanged, except that rdbuf() returns the same value as it returned before the function call, and rhs.rdbuf()returns the same value as it returned before the function call.

void set_rdbuf(basic_streambuf<charT, traits>* sb);

Preconditions: sb != nullptr is true.

Effects: Associates the basic_streambuf object pointed to by sb with this stream without callingclear().

Postconditions: rdbuf() == sb is true.

31.5.4.4 Flags functions [iostate.flags]

explicit operator bool() const;

Returns: The error state of the stream buffer.

void clear(iostate state = goodbit);

Effects: If ((state | (rdbuf() ? goodbit : badbit)) & exceptions()) == 0, returns.

Otherwise, the function throws an object of classios_base​::​failure ([ios.failure]), constructed withimplementation-defined argument values.

Postconditions: Ifrdbuf() != 0thenstate == rdstate(); otherwiserdstate() == (state | ios_base​::​badbit).

void setstate(iostate state);

Effects: Callsclear(rdstate() | state)(which may throwios_base​::​failure ([ios.failure])).

Returns: trueifeofbitis set inrdstate().

Returns: trueiffailbitorbadbitis set inrdstate().265

Returns: trueifbadbitis set inrdstate().

iostate exceptions() const;

Returns: A mask that determines what elements set inrdstate()cause exceptions to be thrown.

void exceptions(iostate except);

Effects: Callsclear(rdstate()).

Postconditions: except == exceptions().

31.5.5 ios_base manipulators [std.ios.manip]

31.5.5.1 fmtflags manipulators [fmtflags.manip]

Each function specified in this subclause is a designated addressable function ([namespace.std]).

ios_base& boolalpha(ios_base& str);

Effects: Callsstr.setf(ios_base​::​boolalpha).

ios_base& noboolalpha(ios_base& str);

Effects: Callsstr.unsetf(ios_base​::​boolalpha).

ios_base& showbase(ios_base& str);

Effects: Callsstr.setf(ios_base​::​showbase).

ios_base& noshowbase(ios_base& str);

Effects: Callsstr.unsetf(ios_base​::​showbase).

ios_base& showpoint(ios_base& str);

Effects: Callsstr.setf(ios_base​::​showpoint).

ios_base& noshowpoint(ios_base& str);

Effects: Callsstr.unsetf(ios_base​::​showpoint).

ios_base& showpos(ios_base& str);

Effects: Callsstr.setf(ios_base​::​showpos).

ios_base& noshowpos(ios_base& str);

Effects: Callsstr.unsetf(ios_base​::​showpos).

ios_base& skipws(ios_base& str);

Effects: Callsstr.setf(ios_base​::​skipws).

ios_base& noskipws(ios_base& str);

Effects: Callsstr.unsetf(ios_base​::​skipws).

ios_base& uppercase(ios_base& str);

Effects: Callsstr.setf(ios_base​::​uppercase).

ios_base& nouppercase(ios_base& str);

Effects: Callsstr.unsetf(ios_base​::​uppercase).

ios_base& unitbuf(ios_base& str);

Effects: Callsstr.setf(ios_base​::​unitbuf).

ios_base& nounitbuf(ios_base& str);

Effects: Callsstr.unsetf(ios_base​::​unitbuf).

31.5.5.2 adjustfield manipulators [adjustfield.manip]

Each function specified in this subclause is a designated addressable function ([namespace.std]).

ios_base& internal(ios_base& str);

Effects: Callsstr.setf(ios_base​::​internal, ios_base​::​adjustfield).

ios_base& left(ios_base& str);

Effects: Callsstr.setf(ios_base​::​left, ios_base​::​adjustfield).

ios_base& right(ios_base& str);

Effects: Callsstr.setf(ios_base​::​right, ios_base​::​adjustfield).

31.5.5.3 basefield manipulators [basefield.manip]

Each function specified in this subclause is a designated addressable function ([namespace.std]).

ios_base& dec(ios_base& str);

Effects: Callsstr.setf(ios_base​::​dec, ios_base​::​basefield).

ios_base& hex(ios_base& str);

Effects: Callsstr.setf(ios_base​::​hex, ios_base​::​basefield).

ios_base& oct(ios_base& str);

Effects: Callsstr.setf(ios_base​::​oct, ios_base​::​basefield).

31.5.5.4 floatfield manipulators [floatfield.manip]

Each function specified in this subclause is a designated addressable function ([namespace.std]).

ios_base& fixed(ios_base& str);

Effects: Callsstr.setf(ios_base​::​fixed, ios_base​::​floatfield).

ios_base& scientific(ios_base& str);

Effects: Callsstr.setf(ios_base​::​scientific, ios_base​::​floatfield).

ios_base& hexfloat(ios_base& str);

Effects: Calls str.setf(ios_base​::​fixed | ios_base​::​scientific, ios_base​::​floatfield).

[Note 1:

ios_base​::​hex cannot be used to specify a hexadecimal floating-point format, because it is not part of ios_base​::​floatfield(Table 135).

— _end note_]

ios_base& defaultfloat(ios_base& str);

Effects: Calls str.unsetf(ios_base​::​floatfield).

31.5.6 Error reporting [error.reporting]

error_code make_error_code(io_errc e) noexcept;

Returns: error_code(static_cast<int>(e), iostream_category()).

error_condition make_error_condition(io_errc e) noexcept;

Returns: error_condition(static_cast<int>(e), iostream_category()).

const error_category& iostream_category() noexcept;

Returns: A reference to an object of a type derived from classerror_category.

The object's default_error_condition and equivalent virtual functions shall behave as specified for the class error_category.

The object's name virtual function shall return a pointer to the string "iostream".