C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can't compile on HP 11.0

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Einat d
Guest





PostPosted: Wed Oct 29, 2003 9:42 am    Post subject: Can't compile on HP 11.0 Reply with quote



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 *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 *,RssLocalRepository::ClsRssUser *>
Quote:
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser

*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair *const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject *> > >
&__rw::__rw_tree_iter<std::pair *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 *,RssLocalRepository::ClsRssUser *>
Quote:
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser

*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair *const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject *> > >::operator =(const
__rw::__rw_tree_iter<std::pair *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 *,RssLocalRepository::ClsRssUser *>
Quote:
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser

*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair *const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject *> > > &)"
["/opt/aCC/include_std/rw/tree", line 153]. Argument of type 'class
__rw_tree_iter<std::pair *const,RssLocalRepository::ClsRssUser
*>,long,std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
*,std::pair<RssLocalRepository::ClsRssObject
*,RssLocalRepository::ClsRssUser *>
&,__rw::__rw_rb_tree_node<std::allocator *,RssLocalRepository::ClsRssUser *>
Quote:
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser

*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair *const,RssLocalRepository::ClsRssUser
*>,RssLocalRepository::ClsRssObject *> > >' could not be converted to
'const __rw::__rw_tree_iter<std::pair *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 *,RssLocalRepository::ClsRssUser *>
Quote:
,std::pair<RssLocalRepository::ClsRssObject
*const,RssLocalRepository::ClsRssUser

*>,RssLocalRepository::ClsRssObject
*,__rw::__select1st<std::pair *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???

Back to top
Rob Williscroft
Guest





PostPosted: Wed Oct 29, 2003 11:33 am    Post subject: Re: Can't compile on HP 11.0 Reply with quote



Einat d wrote in news:f0151441.0310290142.47457366 (AT) posting (DOT) google.com:

Quote:
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.
--
http://www.victim-prime.dsl.pipex.com/

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.