Boost logo

Boost :

Subject: Re: [boost] [config] request for BOOST_NO_FWD_STD_DECLARATION
From: Christopher Jefferson (chris_at_[hidden])
Date: 2011-02-16 13:34:05


On 16 Feb 2011, at 17:10, John Maddock wrote:

>>>> We've already got such a thing, it's called
>>>> 'boost/detail/container_fwd.hpp'. It deals with all the containers
>>>> because it was originally written for the hash library, which needs
>>>> them all. But IMO If you just want a single container, you might as
>>>> well just include the header. They're not that expensive.
>>>
>>> In which case do we need to do anything - other than make the libraries that should use that header but don't, use it?
>>
>> This might pull in a lot more than those libraries need, particularly in the case where we don't use the forward declarations, but pull in all the headers. In the extreme case some places just want pair (although they could just include <utility>)
>
> Well they might... but shouldn't we doing something like:
>
> * If you need several, use container_fwd.hpp.
> * If you need one, just include the necessary header (forward declaring pair is just plain silly IMO).
> * If you need two, then choose which is worst - including two std lib headers or container_fwd.hpp.

So, the main current problem (interprocess)

template <class T>
class allocator;

template <class T>
struct less;

template <class T1, class T2>
struct pair;

template <class CharType>
struct char_traits;

We should just pull in?

#include <utility>
#include <memory>
#include <functional>
#include <iosfwd>

None of those headers is that big, we avoid a big io header with iosfwd.

Chris


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