3 ms·
My Favourite C++ Footgun
- WalterGR 5y agoIt’s been a while since I’ve programmed C++, but both claims seem incorrect. It seems like the author believes there are 3 arguments to `processWidget` when in fact there are only 2. (That said, evaluation order is certainly something to be aware of.) Edit: Oh, I see. From the book: Before processWidget can be called, then, compilers must generate code to do these three things: • Call priority. • Execute “new Widget”. • Call the tr1::shared_ptr constructor. C++ compilers are granted considerable latitude in determining the order in which these things are to be done