woodb...@gmail.com writes:
> Shalom
>
> One of the comments in this thread:
>
https://www.reddit.com/r/cpp/comments/a14o5q/real_world_problems_with_pragma_once/
>
> said that Cray doesn't support pragma once. I know gcc,
> Clang and MSVC do support it. I was wondering if Intel,
> IBM or Oracle compilers support it.
>
> In my software:
>
> I've been using pragma once for a number of years, but
> maybe I should switch to using include guards. In the
> past I had more include files, but now just have a few,
> so switching to include guards would be easy.
To me the (implicit) question here seems like a no-brainer.
It probably cost you more time and effort to do the research
and post here about it than it would have just to change to
using include guards. The main advantage of using include
guards is you know they are going to work and you'll never
have to think about them or wonder if they might be causing
problems. The main advantage of #pragma once is ... what?
Unless there are very particular motivating circumstances,
using #pragma once seems like all potential downside with
negligible upside. Given that the energy barrier to getting
rid of the existing #pragma's is low, just do it and be done
with it. Save your brain for more important matters.
By the way I think the usual #ifndef/#define...#endif style of
include guards is ugly. But they do the job very reliably, so
I just use 'em and move on.