예제 #1
0
    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));
      }

    }
예제 #2
0
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;
}
예제 #3
0
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);
}
예제 #4
0
 static void del(map_type& cont, const key_type& key)
 {
     if ( cont.find(key) != cont.end() ) {
         cont.erase(key);
     }
     else {
         KeyError();
     }
 }
예제 #5
0
 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();
    }
 }
예제 #6
0
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;
}
예제 #7
0
 //! 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;
 }
예제 #8
0
	/**
	 * 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);
		}
	}
예제 #9
0
      std::shared_ptr<ObjectT> remove(const std::string &id) {
        std::shared_ptr<ObjectT> item = get(id);
        if (item != nullptr)
          _objects.erase(id);
				return item;
			}
예제 #10
0
        inline bool remove_factory(message_type type)
        {
            lock guard(m);

            return factories.erase(type);
        }
예제 #11
0
 KOKKOS_INLINE_FUNCTION
 void operator()(typename device_type::size_type i) const
 {
   m_map.erase(i/m_num_duplicates);
 }