Chapter 20. An Unmanaged Pointer Problem, Part 1: Parameter Evaluation
Difficulty: 6
Readers of Exceptional C++ and this book know that exception safety is anything but trivial. This Item points out an exception safety problem that was discovered fairly recently, and shows how best to avoid it in your own code.
In each of the following statements, what can you say about the order of evaluation of the functions
f
,g
, andh
and the expressionsexpr1
andexpr2
? Assume thatexpr1
andexpr2
do not contain more function calls.// Example 20-1(a) // f( expr1, expr2 ); // Example 20-1(b) // f( g( expr1 ), h( expr2 ) );
In your travels through the dusty corners of your company's code archives, you find the following code fragment:
// Example 20-2 // // In ...
Get More Exceptional C++ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.