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


C++ map_type::erase方法代码示例

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


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

示例1: operator

    KOKKOS_INLINE_FUNCTION
    void operator()(typename execution_space::size_type i) const
    {
      if (Near) {
        m_map.erase(i/m_num_duplicates);
      }
      else {
        m_map.erase(i%(m_num_erase/m_num_duplicates));
      }

    }
开发者ID:Pakketeretet2,项目名称:lammps,代码行数:11,代码来源:TestUnorderedMap.hpp

示例2: main

int main(int argc, const char** argv)
{
   std::string text;
   for(int i = 1; i < argc; ++i)
   {
      cout << "Processing file " << argv[i] << endl;
      std::ifstream fs(argv[i]);
      load_file(text, fs);
      fs.close();
      // construct our iterators:
      boost::sregex_iterator m1(text.begin(), text.end(), expression);
      boost::sregex_iterator m2;
      std::for_each(m1, m2, &regex_callback);
      // copy results:
      cout << class_index.size() << " matches found" << endl;
      map_type::iterator c, d;
      c = class_index.begin();
      d = class_index.end();
      while(c != d)
      {
         cout << "class \"" << (*c).first << "\" found at index: " << (*c).second << endl;
         ++c;
      }
      class_index.erase(class_index.begin(), class_index.end());
   }
   return 0;
}
开发者ID:0xDEC0DE8,项目名称:mcsema,代码行数:27,代码来源:regex_iterator_example.cpp

示例3: remove_operation

inline void operation_sequence::remove_operation(int id)
{
    using namespace std;
    map_type::iterator it = operations_.find(id);
    if (it == operations_.end())
        throw runtime_error( string("No such operation: ") + 
                             lexical_cast<string>(id) );
    operations_.erase(it);
}
开发者ID:LocutusOfBorg,项目名称:poedit,代码行数:9,代码来源:operation_sequence.hpp

示例4: del

 static void del(map_type& cont, const key_type& key)
 {
     if ( cont.find(key) != cont.end() ) {
         cont.erase(key);
     }
     else {
         KeyError();
     }
 }
开发者ID:BackupTheBerlios,项目名称:slon,代码行数:9,代码来源:PyLibrary.cpp

示例5: del

 static void del(map_type & x, const key_type & v)
 {
    if (x.count(v) != 0)
    {
       x.erase(v);
    }
    else
    {
       PyErr_SetString(PyExc_IndexError, "Index out of range");
       boost::python::throw_error_already_set();
    }
 }
开发者ID:EnoahNetzach,项目名称:fourFs,代码行数:12,代码来源:wrappers.hpp

示例6: main

int main(int argc, const char** argv)
{
   std::string text;
   for(int i = 1; i < argc; ++i)
   {
      cout << "Processing file " << argv[i] << endl;
      std::ifstream fs(argv[i]);
      load_file(text, fs);
      fs.close();
      IndexClasses(text);
      cout << class_index.size() << " matches found" << endl;
      map_type::iterator c, d;
      c = class_index.begin();
      d = class_index.end();
      while(c != d)
      {
         cout << "class \"" << (*c).first << "\" found at index: " << (*c).second << endl;
         ++c;
      }
      class_index.erase(class_index.begin(), class_index.end());
   }
   return 0;
}
开发者ID:LancelotGHX,项目名称:Simula,代码行数:23,代码来源:regex_grep_example_2.cpp

示例7: restrict

 //! remove assignments for variables in V
 Pass& restrict(const varset_type& V) {
     typedef varset_type::const_iterator viterator;
     const viterator V_end = V.end();
     for (viterator i = V.begin(); i != V_end; ++i) pa.erase(*i);
     return *this;
 }
开发者ID:OKullmann,项目名称:oklibrary,代码行数:7,代码来源:PartAssign.hpp

示例8: release

	/**
	 * Delete the stored element and release the handle, if
	 * it is held by this map.
	 */
	void release(uint32_t handle) {
		if(content.erase(handle)) {
			handlePool->release(handle);
		}
	}
开发者ID:Medo42,项目名称:GM-shared-buffers,代码行数:9,代码来源:HandleMap.hpp

示例9: remove

      std::shared_ptr<ObjectT> remove(const std::string &id) {
        std::shared_ptr<ObjectT> item = get(id);
        if (item != nullptr)
          _objects.erase(id);
				return item;
			}
开发者ID:jamespember,项目名称:HoboQuest,代码行数:6,代码来源:ptr_map.hpp

示例10: remove_factory

        inline bool remove_factory(message_type type)
        {
            lock guard(m);

            return factories.erase(type);
        }
开发者ID:stonedcoldsoup,项目名称:fungus_libs,代码行数:6,代码来源:message.cpp

示例11: operator

 KOKKOS_INLINE_FUNCTION
 void operator()(typename device_type::size_type i) const
 {
   m_map.erase(i/m_num_duplicates);
 }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:5,代码来源:TestUnorderedMap.hpp


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