当前位置: 首页>>代码示例>>C++>>正文


C++ container_t::end方法代码示例

本文整理汇总了C++中container_t::end方法的典型用法代码示例。如果您正苦于以下问题:C++ container_t::end方法的具体用法?C++ container_t::end怎么用?C++ container_t::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在container_t的用法示例。


在下文中一共展示了container_t::end方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: findKey

 const_iterator findKey(const KEY& key) const
 {
     // binary search for key
     const_iterator it(std::lower_bound(m_contents.begin(), m_contents.end(), key, KeyCmp()));
     if (it != m_contents.end() && CMP()(key, it->first)) // it > it-1, check ==
         it = m_contents.end();
     return it;
 }
开发者ID:Weeena,项目名称:ponder,代码行数:8,代码来源:dictionary.hpp

示例2: findValue

 const_iterator findValue(const VALUE& value) const
 {
     for (auto&& it = m_contents.begin(); it != m_contents.end(); ++it)
     {
         if (it->second == value)
             return it;
     }
     return m_contents.end();
 }
开发者ID:Weeena,项目名称:ponder,代码行数:9,代码来源:dictionary.hpp

示例3: insert

 void insert(const KEY &key, const VALUE &value)
 {
     erase(key);
     const pair_t p(key, value);
     auto it = std::lower_bound(m_contents.begin(), m_contents.end(), p);
     m_contents.insert(it, p);
 }
开发者ID:Weeena,项目名称:ponder,代码行数:7,代码来源:dictionary.hpp

示例4: write

void write(const std::string& name, const container_t& cont)
{
	std::cout << name << ": ";

	for( container_t::const_iterator it = cont.begin(); it != cont.end(); ++it )
		std::cout << *it << " ";

	std::cout << "\n";
}
开发者ID:IwishIcanFLighT,项目名称:Asylum_Tutorials,代码行数:9,代码来源:main.cpp

示例5: oldsize

  inline void
  pointmesh2d<point_t>::add_row(container_t const& c)
  {
    std::size_t oldsize(_points.size());

    std::copy(c.begin(), c.end(), std::back_inserter(_points));

    _width = _points.size() - oldsize;
    ++_height;
  }
开发者ID:scholli,项目名称:gpucast,代码行数:10,代码来源:pointmesh2d_impl.hpp

示例6: tryFind

 bool tryFind(const KEY& key, const_iterator& returnValue) const
 {
     const_iterator it = findKey(key);
     if (it != m_contents.end())
     {
         returnValue = it;
         return true;
     }
     return false; // not found
 }
开发者ID:Weeena,项目名称:ponder,代码行数:10,代码来源:dictionary.hpp

示例7: set_add

void set_add(container_t& container, typename container_t::value_type value)
{
    auto it = container.begin();
    while (it != container.end() && *it < value)
    {
        ++it;
    }

    if (*it != value)
    {
        container.insert(it, value);
    }
}
开发者ID:adkozlov,项目名称:cpp-2014,代码行数:13,代码来源:main.cpp

示例8: erase

    void erase(const KEY& key)
    {
        const_iterator it = findKey(key);
        if (it != m_contents.end())
        {
            // Avoid std::vector.erase here due to bug in libstdc++ < v4.9
#if PONDER_WORKAROUND_GCC_N2350
            std::size_t pos = it - m_contents.begin();
            const std::size_t sz = m_contents.size() - 1;
            while (pos < sz)
                m_contents[pos] = m_contents[pos + 1], ++pos;
            m_contents.resize(sz);
#else
            m_contents.erase(it);
#endif
        }
    }
开发者ID:Weeena,项目名称:ponder,代码行数:17,代码来源:dictionary.hpp

示例9: compare

  bool compare(container_t const & lhs, container_t const & rhs, typename container_t::value_type precision)
  {
    if (&lhs == &rhs) {
      return true;
    }
    if (lhs.size() != rhs.size()) {
      return false;
    }
    typename container_t::const_iterator il(lhs.begin());
    typename container_t::const_iterator ir(rhs.begin());
    typename container_t::const_iterator il_end(lhs.end());
    for (/**/; il != il_end; ++il, ++ir) {
      if (fabs(*il - *ir) > precision) {
	return false;
      }
    }
    return true;
  }
开发者ID:digideskio,项目名称:whole_body_control,代码行数:18,代码来源:vector_util.hpp

示例10: zero

 void zero(container_t & vv)
 {
   std::fill(vv.begin(), vv.end(), 0);
 }
开发者ID:digideskio,项目名称:whole_body_control,代码行数:4,代码来源:vector_util.hpp

示例11: end

	const_iterator_t end() const { return &*__container.end(); }
开发者ID:cvalka4,项目名称:cupt,代码行数:1,代码来源:solution.cpp

示例12: end

 const_iterator end() const      { return m_contents.end(); }
开发者ID:Weeena,项目名称:ponder,代码行数:1,代码来源:dictionary.hpp

示例13: containsValue

 bool containsValue(const VALUE& value) const
 {
     return findValue(value) != m_contents.end();
 }
开发者ID:Weeena,项目名称:ponder,代码行数:4,代码来源:dictionary.hpp

示例14: containsKey

 bool containsKey(const KEY& key) const
 {
     return findKey(key) != m_contents.end();
 }
开发者ID:Weeena,项目名称:ponder,代码行数:4,代码来源:dictionary.hpp


注:本文中的container_t::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。