Template:cpp/preprocessor/pragma once

is a non-standard pragma that is supported by the vast majority of modern compilers. If it appears in a header file, it indicates that it is only to be parsed once, even if it is (directly or indirectly) included multiple times in the same source file.

Standard approach to preventing multiple inclusion of the same header is by using include guards:

So that all but the first inclusion of the header in any translation unit are excluded from compilation. All modern compilers record the fact that a header file uses an include guard and do not re-parse the file if it is encountered again, as long as the guard is still defined. (see e.g. gcc)

With, the same header appears as

Unlike header guards, this pragma makes it impossible to erroneously use the same macro name in more than one file. On the other hand, since with files are excluded based on their filesystem-level identity, this can't protect against including a header twice if it exists in more than one location in a project.