Can't compile on HP 11.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Einat d

    Can't compile on HP 11.0

    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: "ClsGetAllRepos itory.cpp", line 107 # No appropriate
    function found for call of 'operator ='. Last viable candidate was
    "__rw::__rw_tre e_iter<std::pai r<RssLocalRepos itory::ClsRssOb ject
    *const,RssLocal Repository::Cls RssUser *>,long,const
    std::pair<RssLo calRepository:: ClsRssObject
    *,RssLocalRepos itory::ClsRssUs er *> *,const
    std::pair<RssLo calRepository:: ClsRssObject
    *,RssLocalRepos itory::ClsRssUs er *>
    &,__rw::__rw_rb _tree_node<std: :allocator<std: :pair<RssLocalR epository::ClsR ssObject
    *,RssLocalRepos itory::ClsRssUs er *>[color=blue]
    >,std::pair<Rss LocalRepository ::ClsRssObject[/color]
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject
    *,__rw::__selec t1st<std::pair< RssLocalReposit ory::ClsRssObje ct
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject *> > >
    &__rw::__rw_tre e_iter<std::pai r<RssLocalRepos itory::ClsRssOb ject
    *const,RssLocal Repository::Cls RssUser *>,long,const
    std::pair<RssLo calRepository:: ClsRssObject
    *,RssLocalRepos itory::ClsRssUs er *> *,const
    std::pair<RssLo calRepository:: ClsRssObject
    *,RssLocalRepos itory::ClsRssUs er *>
    &,__rw::__rw_rb _tree_node<std: :allocator<std: :pair<RssLocalR epository::ClsR ssObject
    *,RssLocalRepos itory::ClsRssUs er *>[color=blue]
    >,std::pair<Rss LocalRepository ::ClsRssObject[/color]
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject
    *,__rw::__selec t1st<std::pair< RssLocalReposit ory::ClsRssObje ct
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject *> > >::operator =(const
    __rw::__rw_tree _iter<std::pair <RssLocalReposi tory::ClsRssObj ect
    *const,RssLocal Repository::Cls RssUser *>,long,const
    std::pair<RssLo calRepository:: ClsRssObject
    *,RssLocalRepos itory::ClsRssUs er *> *,const
    std::pair<RssLo calRepository:: ClsRssObject
    *,RssLocalRepos itory::ClsRssUs er *>
    &,__rw::__rw_rb _tree_node<std: :allocator<std: :pair<RssLocalR epository::ClsR ssObject
    *,RssLocalRepos itory::ClsRssUs er *>[color=blue]
    >,std::pair<Rss LocalRepository ::ClsRssObject[/color]
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject
    *,__rw::__selec t1st<std::pair< RssLocalReposit ory::ClsRssObje ct
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject *> > > &)"
    ["/opt/aCC/include_std/rw/tree", line 153]. Argument of type 'class
    __rw_tree_iter< std::pair<RssLo calRepository:: ClsRssObject
    *const,RssLocal Repository::Cls RssUser
    *>,long,std::pa ir<RssLocalRepo sitory::ClsRssO bject
    *,RssLocalRepos itory::ClsRssUs er *>
    *,std::pair<Rss LocalRepository ::ClsRssObject
    *,RssLocalRepos itory::ClsRssUs er *>
    &,__rw::__rw_rb _tree_node<std: :allocator<std: :pair<RssLocalR epository::ClsR ssObject
    *,RssLocalRepos itory::ClsRssUs er *>[color=blue]
    >,std::pair<Rss LocalRepository ::ClsRssObject[/color]
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject
    *,__rw::__selec t1st<std::pair< RssLocalReposit ory::ClsRssObje ct
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject *> > >' could not be converted to
    'const __rw::__rw_tree _iter<std::pair <RssLocalReposi tory::ClsRssObj ect
    *const,RssLocal Repository::Cls RssUser *>,long,const
    std::pair<RssLo calRepository:: ClsRssObject
    *,RssLocalRepos itory::ClsRssUs er *> *,const
    std::pair<RssLo calRepository:: ClsRssObject
    *,RssLocalRepos itory::ClsRssUs er *>
    &,__rw::__rw_rb _tree_node<std: :allocator<std: :pair<RssLocalR epository::ClsR ssObject
    *,RssLocalRepos itory::ClsRssUs er *>[color=blue]
    >,std::pair<Rss LocalRepository ::ClsRssObject[/color]
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject
    *,__rw::__selec t1st<std::pair< RssLocalReposit ory::ClsRssObje ct
    *const,RssLocal Repository::Cls RssUser
    *>,RssLocalRepo sitory::ClsRssO bject *> > > &'.
    m_connectionPoo lIter = m_connectionPoo l.begin();
    ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^


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

    The definition of the above variables is:
    typedef ConnectionPool: :const_iterator ConnectionPoolC onstIter;
    typedef multimap<ClsRss Object*,
    ClsRssUser*,
    RssObjectPtrCom pare,
    ConnectionAlloc ator > ConnectionPool;

    ConnectionPool m_connectionPoo l;
    ConnectionPoolC onstIter m_connectionPoo lIter;

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

    Can anyone help???
  • Rob Williscroft

    #2
    Re: Can't compile on HP 11.0

    Einat d wrote in news:f0151441.0 310290142.47457 366@posting.goo gle.com:
    [color=blue]
    > m_connectionPoo lIter = m_connectionPoo l.begin();
    > ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^
    >
    >
    > I'm getting the same error for other code lines as well.
    >
    > The definition of the above variables is:
    > typedef ConnectionPool: :const_iterator ConnectionPoolC onstIter;
    > typedef multimap<ClsRss Object*,
    > ClsRssUser*,
    > RssObjectPtrCom pare,
    > ConnectionAlloc ator > ConnectionPool;
    >
    > ConnectionPool m_connectionPoo l;
    > ConnectionPoolC onstIter m_connectionPoo lIter;
    >[/color]

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

    try changing:

    m_connectionPoo lIter = m_connectionPoo l.begin();

    to:

    m_connectionPoo lIter =
    const_cast< ConnectionPool const & >( m_connectionPoo l ).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_connectionPoo lIter = as_const( m_connectionPoo l ).begin();


    HTH

    Rob.
    --

    Comment

    Working...