Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Lifetime of return value in comma separated statements
- struct S
- {
- S() { /* called 1st */ }
- ~S() { /* called 3rd */ }
- };
- boost::shared_ptr<S> f()
- {
- return boost::shared_ptr<S>(new S);
- }
- int second() { return 0; /* called 2nd */ }
- int test()
- {
- return (f(), second());
- }
Add Comment
Please, Sign In to add comment