Boost logo

Boost :

From: Hartmut Kaiser (hartmutkaiser_at_[hidden])
Date: 2004-01-03 17:21:57


Pavel Vozenilek wrote:

> > > > I am inclined towards a new policy for Boost which requires
> > > > compiler identification only via BOOST_-prefixed macros.
> > > >
> > > Not always:
> > >
> > > #if (defined _MSC_VER) && (_MSC_VER >= ...) # pragma once #endif
> > >
> > This may be done through a BOOST_HAS_PRAGMA_ONCE pp
> constant, because
> there
> > are other preprocessors too, which support the #pragma once (for
> > instance Wave :-).
> >
> Right but it would require to include configuration header
> before #pragma and this may negate any potential effect of the pragma.
>
> Also the Intel C++ may behave bug-by-bug or support GCC
> specific feature.
>
> I preferere BOOST_ macros, just not always.

It's a pain to re-iterate all the conditions and compilers, which support
the #pragma once for every

    #if (defined(_MSC_VER) && _MSC_VER >= 1020) || defined(__WAVE__) || etc.
    #pragma once
    #endif

So I mandate for using a BOOST_... constant for this. The Boost.Config
headers are included first anyways, and not using a #pragma once inside
those shouldn't hurt so much.

Regards Hartmut


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk