In this C++ tutorial, we go over how separating function definitions in source files from function declarations in header files can improve compile times.
- We go over four examples that illustrate this point.
- First, we look at how long the assembly code will be when generated from inlined header files.
- Then, we compare that with assembly generated from keeping function definition code separate from the header file.
- After that, we look at how inlining code into multiple files can increase compile times.
- Finally, see how keeping separate header/cpp files can improve compile times by reducing how much work the compiler has to do.
- How C++ Header Files Speedup Compile Times
- Understanding C++ Header Include Compile Times
- C++ Header Files and Compile Times Explained
00:00 Compile Times With Header Files 00:36 Inlining C++ Header File 01:49 Using C++ Header Files 03:23 Inlining C++ in Multiple Files 04:52 Improving Compile Times in C++
- ChatGPT and Gemini