Boost logo

Boost :

Subject: Re: [boost] [config] request for BOOST_NO_FWD_STD_DECLARATION
From: Daniel James (dnljms_at_[hidden])
Date: 2011-02-17 06:12:35


On 16 February 2011 22:51, Christopher Jefferson <chris_at_[hidden]> wrote:
>
> On 16 Feb 2011, at 22:12, Ion Gaztañaga wrote:
>
>> I would need to predeclare allocator, less, and char_traits so that I can use them as default parameters in my own interprocess predeclarations.

allocator and char_traits are already declared. Adding less shouldn't
be a problem.

>> And can't we predeclare libc++ types in the correct namespace, use inline namespaces and avoid any header inclusion?
>
> While I don't speak for libc++, I believe their preference is to not do this, as then if they change the names of the inline namespaces later, it would break boost. Just include the headers instead.

I wouldn't want to deal with anything defined in a nested namespace.
Strikes me as more trouble than it's worth. But if someone else wants
to take over....

> Of course, this shouldn't be imposed on all compilers if it leads to an unacceptable slowdown. It does lead to a massive increase in a pre-processed interprocess_fwd.hpp. Unfortunately the set of things required by interprocess is from various different headers, it wouldn't want to pull in 'container_fwd.hpp'.
>
> I'm not sure if there is demand for a full-blown set of forward declarations for all the standard library. My preference would be a BOOST_CAN_FORWARD_DECLARE_STD macro, and pulling in the real headers in interprocess_fwd.hpp when it isn't defined.

I have no preference. We could break up the header if necessary. The
main issue was dealing with individual library weirdness. But that is
a lot less of a problem nowadays - the libraries were often a bit odd
to deal with compiler bugs or unsupported features, but we don't
really support such compilers anymore. So nowadays in most cases the
issue is warnings caused by differences in the declaration, such as
the clang check for complex in the header (which should have been done
based on library).

Daniel


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