| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 651 人关注过本帖
标题:C++引用、STL改写
只看楼主 加入收藏
zwlsei
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2009-8-7
结帖率:50%
收藏
 问题点数:0 回复次数:0 
C++引用、STL改写
现有一段代码
 bool Contains(MatchIndex idx) const
    {
         AdjListElem e;
        e.m_index = idx.second;
       const MatchAdjList &l = m_match_lists[idx.first];
       std::pair<MatchAdjList::const_iterator,MatchAdjList::const_iterator> p;
            p=equal_range(l.begin(), l.end(), e);
        return (p.first != p.second);
    }
请问各位大侠,这段代码如何改写成非引用的语句?其中AdjListElem、MatchAdjList 、m_match_lists均是定义的容器。

另外,当跟踪到语句p=equal_range(l.begin(), l.end(), e);时直接跳到class vector : public _Vector_base<_Tp, _Alloc>中的语句const_iterator end() const   { return this->_M_finish; }处,请问这是什么错误?

在线等待,多谢各位大侠帮助!
搜索更多相关主题的帖子: STL 
2010-01-21 10:17
快速回复:C++引用、STL改写
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017970 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved