cppbestpractices
cppbestpractices copied to clipboard
Consider adding Compiler Explorer links to Considering Performance chapter
A counter point to the std::bind
section seems to prove there isn't a runtime overhead for the example given: https://godbolt.org/g/ZcUgRr
- Ternary operator (it's actually shocking how bad the had version is): https://godbolt.org/g/6bALYs
- Self calling lamdba (again, bad is really bad): https://godbolt.org/g/rGhTSX
- Initializer lists: https://godbolt.org/g/cvfZxs etc..
The code size difference for the ternary operator and self-calling lambda examples isn't nearly as big if you compile with C++11 or C++14. The "bad" code size only explodes with C++17 for some reason.