Our project currently uses header guards. However, all the compilers we currently support (and wish to support) support the #pragma once directive and have done so for a long time.
The advantages of using #pragma once over traditional header guards are numerous:
- It's more readable
- It's faster to write
- There is no risk of header guard collision (two headers accidentally picking the same guard)
For this reason, I propose moving the project to using #pragma once instead of clunky #ifndef header guards.
Our project currently uses header guards. However, all the compilers we currently support (and wish to support) support the
#pragma oncedirective and have done so for a long time.The advantages of using
#pragma onceover traditional header guards are numerous:For this reason, I propose moving the project to using
#pragma onceinstead of clunky#ifndefheader guards.