本文整理汇总了C++中intVector::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ intVector::clear方法的具体用法?C++ intVector::clear怎么用?C++ intVector::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类intVector
的用法示例。
在下文中一共展示了intVector::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
DatabaseCorrelation::GetCorrelatedTimeStates(int state, intVector &states) const
{
bool retval = false;
if(state >= 0 && state < numStates)
{
states.clear();
int index = state;
for(size_t i = 0; i < databaseNames.size(); ++i)
{
states.push_back(indices[index]);
index += numStates;
}
retval = true;
}
return retval;
}
示例2: SM_ComputeDistribution
// compute the distribution of correspondence statuses in this order:
// connected, paused, observed, expected, blacklisted, alternate, silent
void SM_ComputeDistribution( intVector &dist )
{
// reset the distribution
dist.clear();
for (int i=0; i<3; i++)
dist.push_back( 0 );
// populate the distribution
for ( corresVector::iterator iter = cq.begin(); iter != cq.end(); iter++ ) {
switch ( iter->status() ) {
case _CONNECTED:
dist[0]++;
break;
case _EXPECTED:
dist[1]++;
break;
case _BLACKLISTED:
dist[2]++;
break;
default:
assert( false );
}
}
}