本文整理汇总了C++中uuid_vec_t::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ uuid_vec_t::resize方法的具体用法?C++ uuid_vec_t::resize怎么用?C++ uuid_vec_t::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uuid_vec_t
的用法示例。
在下文中一共展示了uuid_vec_t::resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeDifference
void LLCommonUtils::computeDifference(
const uuid_vec_t& vnew,
const uuid_vec_t& vcur,
uuid_vec_t& vadded,
uuid_vec_t& vremoved)
{
uuid_vec_t vnew_copy(vnew);
uuid_vec_t vcur_copy(vcur);
std::sort(vnew_copy.begin(), vnew_copy.end());
std::sort(vcur_copy.begin(), vcur_copy.end());
size_t maxsize = llmax(vnew_copy.size(), vcur_copy.size());
vadded.resize(maxsize);
vremoved.resize(maxsize);
uuid_vec_t::iterator it;
// what was removed
it = set_difference(vcur_copy.begin(), vcur_copy.end(), vnew_copy.begin(), vnew_copy.end(), vremoved.begin());
vremoved.erase(it, vremoved.end());
// what was added
it = set_difference(vnew_copy.begin(), vnew_copy.end(), vcur_copy.begin(), vcur_copy.end(), vadded.begin());
vadded.erase(it, vadded.end());
}
示例2: getSelectedItemsUUIDs
void LLOutfitsList::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const
{
// Collect selected items from all selected lists.
for (wearables_lists_map_t::const_iterator iter = mSelectedListsMap.begin();
iter != mSelectedListsMap.end();
++iter)
{
uuid_vec_t uuids;
(*iter).second->getSelectedUUIDs(uuids);
S32 prev_size = selected_uuids.size();
selected_uuids.resize(prev_size + uuids.size());
std::copy(uuids.begin(), uuids.end(), selected_uuids.begin() + prev_size);
}
}