本文整理汇总了C++中HashTable::cend方法的典型用法代码示例。如果您正苦于以下问题:C++ HashTable::cend方法的具体用法?C++ HashTable::cend怎么用?C++ HashTable::cend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HashTable
的用法示例。
在下文中一共展示了HashTable::cend方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: abort
void Foam::HashTable<T, Key, Hash>::operator=
(
const HashTable<T, Key, Hash>& rhs
)
{
// Check for assignment to self
if (this == &rhs)
{
FatalErrorInFunction
<< "attempted assignment to self"
<< abort(FatalError);
}
// Could be zero-sized from a previous transfer()
if (!tableSize_)
{
resize(rhs.tableSize_);
}
else
{
clear();
}
for (const_iterator iter = rhs.cbegin(); iter != rhs.cend(); ++iter)
{
insert(iter.key(), *iter);
}
}
示例2: insert
Foam::HashTable<T, Key, Hash>::HashTable(const HashTable<T, Key, Hash>& ht)
:
HashTable<T, Key, Hash>(ht.tableSize_)
{
for (const_iterator iter = ht.cbegin(); iter != ht.cend(); ++iter)
{
insert(iter.key(), *iter);
}
}
示例3:
Foam::HashSet<Key, Hash>::HashSet
(
const HashTable<AnyType, Key, AnyHash>& h
)
:
HashTable<nil, Key, Hash>(h.size())
{
for
(
typename HashTable<AnyType, Key, AnyHash>::const_iterator
cit = h.cbegin();
cit != h.cend();
++cit
)
{
this->insert(cit.key());
}
}
示例4: find
bool Foam::HashTable<T, Key, Hash>::operator==
(
const HashTable<T, Key, Hash>& rhs
) const
{
// Sizes (number of keys) must match
if (size() != rhs.size())
{
return false;
}
for (const_iterator iter = rhs.cbegin(); iter != rhs.cend(); ++iter)
{
const_iterator fnd = find(iter.key());
if (fnd == cend() || fnd() != iter())
{
return false;
}
}
return true;
}