Pragma once
C/C++ directive to block repeated header inclusions
C/C++ directive to block repeated header inclusions
In the C and C++ programming languages, #pragma once is a non-standard but widely supported preprocessor directive designed to cause the current header file to be included only once in a single compilation. Thus, #pragma once serves the same purpose as #include guards, but with several advantages, including less code, avoidance of name clashes, and sometimes improvement in compilation speed. While #pragma once is available in most modern compilers, it remains outside of the standard, and its implementation is tricky and may not always be reliable. Modules, introduced in C++20, use an import keyword, eliminating the necessity of #pragma once due to not being handled by the preprocessor. Modules can only be imported at most one time into a translation unit.
Open boosters, collect cards and trade them. Free to play.
Play for free