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)); } }
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, ®ex_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; }
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); }
static void del(map_type& cont, const key_type& key) { if ( cont.find(key) != cont.end() ) { cont.erase(key); } else { KeyError(); } }
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(); } }
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; }
//! 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; }
/** * 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); } }
std::shared_ptr<ObjectT> remove(const std::string &id) { std::shared_ptr<ObjectT> item = get(id); if (item != nullptr) _objects.erase(id); return item; }
inline bool remove_factory(message_type type) { lock guard(m); return factories.erase(type); }
KOKKOS_INLINE_FUNCTION void operator()(typename device_type::size_type i) const { m_map.erase(i/m_num_duplicates); }