Can't compile on HP 11.0

Discussion in 'C++' started by Einat d, Oct 29, 2003.

  1. Einat d

    Einat d Guest

    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???
    Einat d, Oct 29, 2003
    #1
    1. Advertising

  2. Einat d wrote in news::

    > 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/
    Rob Williscroft, Oct 29, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nagaraj
    Replies:
    1
    Views:
    822
    Lionel B
    Mar 1, 2007
  2. timjowers
    Replies:
    7
    Views:
    4,296
    heyjude
    Feb 2, 2011
  3. Replies:
    1
    Views:
    428
    Cowboy \(Gregory A. Beamer\)
    Apr 11, 2008
  4. Carter
    Replies:
    2
    Views:
    484
    Carter
    Mar 4, 2009
  5. fAnSKyer
    Replies:
    2
    Views:
    508
    Alf P. Steinbach
    Jun 7, 2009
Loading...

Share This Page