Can't compile on HP 11.0

E

Einat d

HELP!

This code compiles fine on the Solaris and AIX platform but for some
reasone fails on the HP 11 platform.

Here is the error I'm getting:

Error 226: "ClsGetAllRepository.cpp", line 107 # No appropriate
function found for call of 'operator ='. Last viable candidate was
"__rw::__rw_tree_iter<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser *>,long,const
std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *> *,const
std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
&,__rw::__rw_rb_tree_node<std::allocator<std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject *> > >
&__rw::__rw_tree_iter<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser *>,long,const
std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *> *,const
std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
&,__rw::__rw_rb_tree_node<std::allocator<std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject *> > >::eek:perator =(const
__rw::__rw_tree_iter<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser *>,long,const
std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *> *,const
std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
&,__rw::__rw_rb_tree_node<std::allocator<std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject *> > > &)"
["/opt/aCC/include_std/rw/tree", line 153]. Argument of type 'class
__rw_tree_iter<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,long,std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
*,std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
&,__rw::__rw_rb_tree_node<std::allocator<std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject *> > >' could not be converted to
'const __rw::__rw_tree_iter<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser *>,long,const
std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *> *,const
std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
&,__rw::__rw_rb_tree_node<std::allocator<std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject *> > > &'.
m_connectionPoolIter = m_connectionPool.begin();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


I'm getting the same error for other code lines as well.

The definition of the above variables is:
typedef ConnectionPool::const_iterator ConnectionPoolConstIter;
typedef multimap<ClsRssObject*,
ClsRssUser*,
RssObjectPtrCompare,
ConnectionAllocator > ConnectionPool;

ConnectionPool m_connectionPool;
ConnectionPoolConstIter m_connectionPoolIter;

Here is the output for "aCC -V":
aCC: HP ANSI C++ B3910B A.03.27

Can anyone help???
 
R

Rob Williscroft

Einat d wrote in
m_connectionPoolIter = m_connectionPool.begin();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


I'm getting the same error for other code lines as well.

The definition of the above variables is:
typedef ConnectionPool::const_iterator ConnectionPoolConstIter;
typedef multimap<ClsRssObject*,
ClsRssUser*,
RssObjectPtrCompare,
ConnectionAllocator > ConnectionPool;

ConnectionPool m_connectionPool;
ConnectionPoolConstIter m_connectionPoolIter;

The compiler that compiles implements a convertion from
std::multimap<>::iterator to std::multimap<>::const_iterator.

try changing:

m_connectionPoolIter = m_connectionPool.begin();

to:

m_connectionPoolIter =
const_cast< ConnectionPool const & >( m_connectionPool ).begin()
;

Note that the compiler that fails (well it standard library) is
non-conformant, so the above is a workaround. I don't think this
failure is that uncommon.

If you don't like having a const_cast<> in your code (who does :)

template < typename T >
inline T const &as_const( T const &a )
{
return a;
}

m_connectionPoolIter = as_const( m_connectionPool ).begin();


HTH

Rob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top