
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 Too late for gcc 3.4 but I will submit a bug report if no one else has already done so. Michael -- ___________________________________ Michael Stevens Systems Engineering Navigation Systems, Estimation and Bayesian Filtering http://www.sf.net/Bayes++ ___________________________________

Michael Stevens <Michael.Stevens@epost.de> 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

David Abrahams wrote:
#if BOOST_WORKAROUND(__GNUC__, == 3) && __GNUC_MINOR__ >=4 #include <vector> #else namespace std { template <class T, class Allocator> class vector; } #endif
I assume (have not verified) that the problem is related to hidden template parameters in the gcc-3.4 implementations of the std containers.
No, it's related to a change in the internal standard library implementation that was introduced when the debug mode was added (the debug mode adds sanity checks for iterators and stuff). Namely, those templates are now defined in a different namespace and then imported into namespace std through a special extension in the compiler.
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.
Yes, the forward declartion invokes undefined behaviour. -- Giovanni Bajo
participants (3)
-
David Abrahams
-
Giovanni Bajo
-
Michael Stevens