Boost logo

Boost :

Subject: Re: [boost] [#pragma once]
From: Bo Persson (bop_at_[hidden])
Date: 2009-04-11 04:49:06

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?"
>> 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

Boost list run by bdawes at, gregod at, cpdaniel at, john at