|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-04-08 08:21:12
Michael Stevens <Michael.Stevens_at_[hidden]> writes:
> Hi All, (particularly Jaakko!)
>
> While working on using BLL's operator return type mechanism in uBLAS I
> stumbled on the problem the recent (snapshot) GCC-3.4 has with BLL.
>
> I noticed Jaakoo checked in the following patch a few days ago as a
> workaround.
>
> #if BOOST_WORKAROUND(__GNUC__, == 3) && __GNUC_MINOR__ >=4
> #include <vector>
> #else
> namespace std {
> template <class T, class Allocator> class vector;
> }
> #endif
>
>>From my own research the problem is not just restricted to 'std::vector'. It
> certainly also occurs with 'std::map'.
>
> I assume (have not verified) that the problem is related to hidden template
> parameters in the gcc-3.4 implementations of the std containers.
>
> OR is the problem simply a bug (an regression) in gcc 3.4
An implementation is allowed to add hidden template parameters. The
"workaround" is actually the only portably correct code; the forward
declaration isn't guaranteed to work. In fact, I think it invokes
undefined behavior.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk