When to use include guards or #pragma once C++ [closed]
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . Is it good practice to use your choice of either/both include guards and #pragma once in every header file, or just those with something such as a class declaration? I am tempted to put it in every header, but I'm afraid it would be unneeded and only add to the compile time.