Sets sb as the stream buffer associated with the stream, without altering the control state flag (rdstate) and sb shall not be a null pointer.
Derived classes can call this function to implement custom swap functions.
Following is the declaration for set_rdbuf function.
void set_rdbuf (streambuf* sb);
sb − Pointer to a streambuf object(This shall not be a null pointer).
Basic guarantee − if an exception is thrown, the stream is in a valid state.
Modifies the stream object.
Concurrent access to the same stream object may cause data races.