Subject: Re: [boost] [#pragma once]
From: Raindog (raindog_at_[hidden])
Date: 2009-04-11 23:07:04
Bo Persson wrote:
> 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/c527240043c8df92
> >> 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
Yet another example of the weakness of the C++ (lack of) project model...
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk