From: Daniel James (daniel_james_at_[hidden])
Date: 2007-11-08 15:08:12
Giovanni Piero Deretta wrote:
> On Nov 8, 2007 2:19 AM, Yingwei Zhang <ywz_at_[hidden]> wrote:
>> Hello -
>> I am migrating our code base from boost 1.33.1 to 1.34.1. Some changes in boost/functional is causing compilation issues. The hash.hpp in 1.33 does include std container header files. In 1.34.1, however, forward declaration is added as following:
> If you need the container headers you should include them, not rely on
> a third party header including it. In fact in this case conatainer_fwd
> IMHO does exactly the right thing. It forwards declare std containers
> when he thinks it is safe to do so. If It can't it includes them.
> Forward declaring standard containers without including the headers is
> something that comes handy very often.
That's exactly the reasoning. There was a fair amount of demand for this
change. And I this is the first time anyone has been against it (and
it's quite a long time since it was introduced).
It's also worth noting that if in the future you used the standard C++
<functional> header instead you'd need to include the container headers
Unfortunately, the error messages are often confusing. Also, code that
works on some platforms won't work on others - this also applies to the
standard headers. I think this is part of the C++ condition.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk