I'm in the process of learning C++ and I have a real world question about coding the .h include files.
In my reading the authors spent some time on using the
#ifdedf and #ifndef preprocessor directives to bracket the #include to prevent the file from being included multiple times in a compile. The consequence of multiple insertions of the include seemed to be more about wasted time and resources if I have correctly understood.
My question is: Is it important to bracket #include directives to prevent a file from being included multiple times or is this more an academic concern that is not important in the real world? Example follows:
// Example of guarded include file
#ifndef exampleInclude // test to see if the include has already happened
#define exampleInclude // define the item so later tests fail
#include <exampleInclude> // include the file
#endif
// Rinse and repeat for all include files