|
Boost Users : |
Subject: [Boost-users] compiling error after upgrading from boost 1.33.1 to boost 1.36.0
From: Henson Huang (henson_huang_at_[hidden])
Date: 2013-08-13 22:35:37
Hello,
I upgraded the boost library in my workstation from boost 1.33.1 to boost
1.36.0. When I compiled my program, I got following errors,
/usr/include/boost/detail/sp_counted_impl.hpp:192: error: template argument
3 is invalid
/usr/include/boost/detail/sp_counted_impl.hpp:198: error: 'a' has not been
declared
/usr/include/boost/detail/sp_counted_impl.hpp: In constructor
'boost::detail::sp_counted_impl_pda<P, D, <template-parameter-1-3>
>::sp_counted_impl_pda(P, D, int)':
/usr/include/boost/detail/sp_counted_impl.hpp:198: error: 'a' was not
declared in this scope
/usr/include/boost/detail/sp_counted_impl.hpp: In member function 'virtual
void boost::detail::sp_counted_impl_pda<P, D, <template-parameter-1-3>
>::destroy()':
/usr/include/boost/detail/sp_counted_impl.hpp:209: error: expected
nested-name-specifier before 'template'
/usr/include/boost/detail/sp_counted_impl.hpp:209: error: expected
unqualified-id before 'template'
/usr/include/boost/detail/sp_counted_impl.hpp:211: error: 'A2' was not
declared in this scope
/usr/include/boost/detail/sp_counted_impl.hpp:211: error: expected `;'
before 'a2'
/usr/include/boost/detail/sp_counted_impl.hpp:214: error: 'a2' was not
declared in this scope
I'm using gcc 4.1.2.
Below is the file sp_counted_impl.hpp line 181 ~ 221,
template<class P, class D, class A> class sp_counted_impl_pda: public
sp_counted_base
{
private:
P p_; // copy constructor must not throw
D d_; // copy constructor must not throw
A a_; // copy constructor must not throw
sp_counted_impl_pda( sp_counted_impl_pda const & );
sp_counted_impl_pda & operator= ( sp_counted_impl_pda const & );
typedef sp_counted_impl_pda<P, D, A> this_type; //This is
the line 192
public:
// pre: d( p ) must not throw
sp_counted_impl_pda( P p, D d, A a ): p_( p ), d_( d ), a_( a )
{
}
virtual void dispose() // nothrow
{
d_( p_ );
}
virtual void destroy() // nothrow
{
typedef typename A::template rebind< this_type >::other A2;
A2 a2( a_ );
this->~this_type();
a2.deallocate( this, 1 );
}
virtual void * get_deleter( detail::sp_typeinfo const & ti )
{
return ti == BOOST_SP_TYPEID( D )? &reinterpret_cast<char&>( d_ ):
0;
}
};
Please help to see how to resolve these errors.
Best regards,
Hua
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net