[Insight-developers] pragma once]

Kent Williams kent at psychiatry.uiowa.edu
Thu May 25 12:21:36 EDT 2006


The standard behavior of C/C++ compilers is to ignore #pragmas they 
don't implement.

I would think that given that we use #ifdef file guards everywhere, it 
would be safe to use #pragma once.  If it isn't honored, everything will 
still work, with the possible overhead of including something already 
included.

Is there a situation where using #pragma once is anything more than a 
hint to the compiler to short-circuit parsing an include file?

Stephen R. Aylward wrote:

> Hi,
>
> Has anyone already investigated whether or not all of the supported 
> ITK compilers honor the "#pragma once" directive?
>
> Thanks,
> Stephen
>



More information about the Insight-developers mailing list