
Raindog wrote:
Niels Dekker - address until 2010-10-10 wrote:
BTW, #pragma once has been discussed extensively at comp.std.c++, December 2007: "#pragma once in ISO standard yet?" http://groups.google.com/group/comp.std.c++/browse_thread/thread/c527240043c...
Apparently it's hard to implement such a #pragma in a reliable way.
From what I understand, it's also hard to implement templates and multiple inheritance...or exception safety in code...but we have those =)
The #pragma once depends on the compiler being able to correctly parse the include paths for all possibly attached file systems. If it fails, it might include the same file twice from seemingly different paths. With the #ifdef/#endif idiom, an occational extra include just adds a small amount of time to the compile. Bo Persson