C++ Basic_ios - Constructor


Advertisements

Description

The initialization constructor (1) initializes the stream object by calling init(sb).

If invoked by a derived class using the default constructor (2), it constructs an object leaving its members uninitialized. In this case the object shall be explicitly initialized by calling init at some point before its first use or before it is destroyed (if never used).

The copy constructor (3) is explicitly deleted (as well as the copy assignment overload of operator=).

Declaration

Following is the declaration for basic_ios::basic_ios.

C++98

intialization (1)
   public: explicit basic_ios (basic_streambuf<char_type,traits_type>* sb);
default (2)
   protected: basic_ios();

C++11

intialization (1)
   public: explicit basic_ios (basic_streambuf<char_type,traits_type>* sb);
default (2)
   protected: basic_ios();
copy (3)	
   basic_ios (const basic_ios&) = delete;
   basic_ios& operator= (const basic_ios&) = delete;

Parameters

sb − pointer to a basic_streambuf object with the same template parameters as the basic_ios object. char_type and traits_type are member types defined as aliases of the first and second class template parameters, respectively (see basic_ios types).

Exceptions

If an exception is thrown, the only side effects may come from accessing/modifying sb.

Data races

The object pointed by sb may be accessed and/or modified.

ios.htm
Advertisements