GCC supports #pragma once
since 3.4, see http://en.wikipedia.org/wiki/Pragma_once for further compiler support.
The big upside I see on using #pragma once
as opposed to include guards is to avoid copy/paste errors.
Let's face it: most of us hardly start a new header file from scratch, but rather just copy an existing one and modify it to our needs. It is much easier to create a working template using #pragma once
instead of include guards. The less I have to modify the template, the less I am likely to run into errors. Having the same include guard in different files leads to strange compiler errors and it takes some time to figure out what went wrong.
TL;DR: #pragma once
is easier to use.