本文整理汇总了C++中token::intersect方法的典型用法代码示例。如果您正苦于以下问题:C++ token::intersect方法的具体用法?C++ token::intersect怎么用?C++ token::intersect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类token
的用法示例。
在下文中一共展示了token::intersect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersect
void intersect (basic_charset &rhs_, basic_charset &overlap_)
{
_token.intersect (rhs_._token, overlap_._token);
if (!overlap_._token.empty ())
{
typename index_set::const_iterator iter_ = _index_set.begin ();
typename index_set::const_iterator end_ = _index_set.end ();
for (; iter_ != end_; ++iter_)
{
overlap_._index_set.insert (*iter_);
}
iter_ = rhs_._index_set.begin ();
end_ = rhs_._index_set.end ();
for (; iter_ != end_; ++iter_)
{
overlap_._index_set.insert (*iter_);
}
if (_token.empty ())
{
_index_set.clear ();
}
if (rhs_._token.empty ())
{
rhs_._index_set.clear ();
}
}
}
示例2: intersect
void intersect (basic_charset &rhs_, basic_charset &overlap_)
{
_token.intersect (rhs_._token, overlap_._token);
if (!overlap_._token.empty ())
{
std::merge (_index_set.begin (), _index_set.end (),
rhs_._index_set.begin (), rhs_._index_set.end (),
std::inserter (overlap_._index_set,
overlap_._index_set.end ()));
if (_token.empty ())
{
_index_set.clear ();
}
if (rhs_._token.empty ())
{
rhs_._index_set.clear ();
}
}
}