Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
sentry member class
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="john, post: 3057298"] I am reading TC++PL3 and in 21.3.8 it describes the class sentry, which is member of basic_istream and basic_ostream. Q1: Should we always use the sentry class when we define new functions and operators for basic_ostream/basic_istream (ostream/istream)? Q2: It is mentioned that we can place code "such as throwing exceptions caused by state changes" in the sentry's destructor. However in 14.4.7 it is mentioned: "Exiting from a destructor by throwing an exception is also a violation of the standard library requirements (E2)". I suppose both sentry's constructor and destructor, are to be provided by the implementer of the standard library basic_istream and basic_ostream classes? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
sentry member class
Top