本文整理汇总了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));
}
}
示例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, ®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;
}
示例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);
}
示例4: del
static void del(map_type& cont, const key_type& key)
{
if ( cont.find(key) != cont.end() ) {
cont.erase(key);
}
else {
KeyError();
}
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例10: remove_factory
inline bool remove_factory(message_type type)
{
lock guard(m);
return factories.erase(type);
}
示例11: operator
KOKKOS_INLINE_FUNCTION
void operator()(typename device_type::size_type i) const
{
m_map.erase(i/m_num_duplicates);
}