本文整理汇总了C++中TypeSet::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeSet::erase方法的具体用法?C++ TypeSet::erase怎么用?C++ TypeSet::erase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeSet
的用法示例。
在下文中一共展示了TypeSet::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: allTypes
TEST(Type, CanRunDtor) {
TypeSet types = allTypes();
auto expectTrue = [&](Type t) {
EXPECT_TRUE(t.canRunDtor()) << t.toString() << ".canRunDtor() == true";
types.erase(t);
};
expectTrue(Type::Arr);
expectTrue(Type::CountedArr);
expectTrue(Type::Obj);
expectTrue(Type::Res);
expectTrue(Type::Counted);
expectTrue(Type::BoxedArr);
expectTrue(Type::BoxedCountedArr);
expectTrue(Type::BoxedObj);
expectTrue(Type::BoxedRes);
expectTrue(Type::BoxedCell);
expectTrue(Type::Cell);
expectTrue(Type::Gen);
expectTrue(Type::Ctx);
expectTrue(Type::Obj | Type::Func);
expectTrue(Type::Init);
expectTrue(Type::Top);
expectTrue(Type::StackElem);
expectTrue(Type::AnyObj);
expectTrue(Type::AnyRes);
expectTrue(Type::AnyArr);
expectTrue(Type::AnyCountedArr);
expectTrue(Type::AnyCell);
for (Type t : types) {
EXPECT_FALSE(t.canRunDtor()) << t.toString() << ".canRunDtor == false";
}
}
示例2: remove_interfaces_for_root
void RemoveInterfacePass::remove_interfaces_for_root(
const Scope& scope,
const DexStoresVector& stores,
const DexType* root,
const TypeSystem& type_system) {
TRACE(RM_INTF, 5, "Processing root %s\n", SHOW(root));
TypeSet interfaces;
type_system.get_all_interface_children(root, interfaces);
include_parent_interfaces(root, interfaces);
m_total_num_interface += interfaces.size();
m_num_interface_excluded += exclude_unremovables(
scope, stores, type_system, m_skip_multiple_targets_roots,
m_include_primary_dex, interfaces);
TRACE(RM_INTF, 5, "removable interfaces %ld\n", interfaces.size());
TypeSet removed =
remove_leaf_interfaces(scope, root, interfaces, type_system);
while (removed.size() > 0) {
for (const auto intf : removed) {
interfaces.erase(intf);
m_removed_interfaces.insert(intf);
}
TRACE(RM_INTF, 5, "non-leaf removable interfaces %ld\n", interfaces.size());
removed = remove_leaf_interfaces(scope, root, interfaces, type_system);
}
// Update type reference to removed interfaces all at once.
remove_interface_references(scope, type_system, root, m_removed_interfaces);
if (traceEnabled(RM_INTF, 9)) {
TypeSystem updated_ts(scope);
for (const auto intf : interfaces) {
TRACE(RM_INTF, 9, "unremoved interface %s\n", SHOW(intf));
TypeSet children;
updated_ts.get_all_interface_children(intf, children);
for (const auto cintf : children) {
TRACE(RM_INTF, 9, " child %s\n", SHOW(cintf));
}
}
}
}