Boost logo

Boost :

Subject: Re: [boost] [config] request for BOOST_NO_FWD_STD_DECLARATION
From: Christopher Jefferson (chris_at_[hidden])
Date: 2011-02-16 17:51:41


On 16 Feb 2011, at 22:12, Ion Gaztañaga wrote:

> El 16/02/2011 19:40, Daniel James escribió:
>> On 16 February 2011 18:34, Christopher Jefferson<chris_at_[hidden]> wrote:
>>>
>>> So, the main current problem (interprocess)
>>
>> You should ask on a new thread with '[interprocess]' in the title, or
>> post a ticket. Ion probably won't be reading this thread.
>>
>> I'm not against splitting up container_fwd.hpp if that's what people want.
>
> I've received the ticket. I have no problem to use a std predeclaration file like boost/detail/container_fwd.hpp, but shouldn't those predeclarations contain default parameters?

No, with templates you only get to declare the default parameters once, so you must not put them on. if you do, including the real std header later doesn't compile.

> I would need to predeclare allocator, less, and char_traits so that I can use them as default parameters in my own interprocess predeclarations.
>
> 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.

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.

Chris


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