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++
order of evaluation of arguments to constructors
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="Peter, post: 2769045"] I know the order of construction of member and base class objects. My question is the following: Is the order of evaluation of argument lists for these constructors also defined? E.g. can I assume that the following code is exceptions safe? Assuming that the constructor of A, B or C may throw? Can I assume that B is created after the constructor of m_sA has been called? struct D { std::auto_ptr<A> m_sA; std::auto_ptr<B> m_sB; std::auto_ptr<C> m_sC; D(void) :m_sA(new A), m_sB(new B), m_sC(new C) { } }; [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
order of evaluation of arguments to constructors
Top