reference to void in shared_ptr_nmt

Hello, I am encountering the following problem when using boost with shared pointers (Ubuntu Edgy, G++4.1/4.0/3.4): ======================= /usr/include/boost/detail/shared_ptr_nmt.hpp:115: error: forming reference to void shared_ptr_nmt.hpp:114: error: forming reference to void ========================== the source code reads : ========================= T & operator*() const // never throws { BOOST_ASSERT(px != 0); return *px; } ========================= To me, this seems like a g++ (GNU GCC) problem, (It seems that G++ checks if void would be a viable substitutiion for T) however, I have tried three different versions of g++ and get the same result every time. There once was such a bug in GCC but it has been resolved ages ago. Regards, Oliver Kania

Oliver Kania wrote:
Hello, I am encountering the following problem when using boost with shared pointers (Ubuntu Edgy, G++4.1/4.0/3.4): ======================= /usr/include/boost/detail/shared_ptr_nmt.hpp:115: error: forming reference to void shared_ptr_nmt.hpp:114: error: forming reference to void ========================== the source code reads : ========================= T & operator*() const // never throws { BOOST_ASSERT(px != 0); return *px; }
You shouldn't be getting shared_ptr_nmt.hpp at all on g++, this is the "ancient compiler" version. Your config incorrectly defines BOOST_NO_MEMBER_TEMPLATES for some reason, or someone is including the _nmt header directly (which shouldn't be done).

Thanx, this helped because I am now 90% sure that the auto-build tool I use is messing things up. Peter Dimov wrote:
Oliver Kania wrote:
Hello, I am encountering the following problem when using boost with shared pointers (Ubuntu Edgy, G++4.1/4.0/3.4): ======================= /usr/include/boost/detail/shared_ptr_nmt.hpp:115: error: forming reference to void shared_ptr_nmt.hpp:114: error: forming reference to void ========================== the source code reads : ========================= T & operator*() const // never throws { BOOST_ASSERT(px != 0); return *px; }
You shouldn't be getting shared_ptr_nmt.hpp at all on g++, this is the "ancient compiler" version. Your config incorrectly defines BOOST_NO_MEMBER_TEMPLATES for some reason, or someone is including the _nmt header directly (which shouldn't be done).
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Oliver Kania
-
Peter Dimov