I am sure that it works the same as include_once in PHP - there is a table of "files that were included." In this case, the compiler scans the list for the file that it should include, and if the file is already included, do not include it again. If the compiler, processing the file, sees #pragma once , and then adds this file to the "files that have already been included."
Thus, this is not the same as turning on guards at the level of detail, but it has the same effect as turning on guards. It also makes the code less portable, as there are many compilers that do not support this.
source share