本文整理汇总了C++中Iter::search_above_dst方法的典型用法代码示例。如果您正苦于以下问题:C++ Iter::search_above_dst方法的具体用法?C++ Iter::search_above_dst怎么用?C++ Iter::search_above_dst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Iter
的用法示例。
在下文中一共展示了Iter::search_above_dst方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
// We've seen this node before, and therefore have already searched
// its base classes above.
// Update path to here that is "most public".
if (path_below == public_path)
info->path_dynamic_ptr_to_dst_ptr = public_path;
}
else // We have haven't been here before
{
// Record the access path that got us here
// If there is more than one dst_type this path doesn't matter.
info->path_dynamic_ptr_to_dst_ptr = path_below;
// Only search above here if dst_type derives from static_type, or
// if it is unknown if dst_type derives from static_type.
if (info->is_dst_type_derived_from_static_type != no)
{
// Set up flags to record results from all base classes
bool is_dst_type_derived_from_static_type = false;
bool does_dst_type_point_to_our_static_type = false;
// We've found a dst_type with a potentially public path to here.
// We have to assume the path is public because it may become
// public later (if we get back to here with a public path).
// We can stop looking above if:
// 1. We've found a public path to (static_ptr, static_type).
// 2. We've found an ambiguous cast from (static_ptr, static_type) to a dst_type.
// This is detected at the (static_ptr, static_type).
// 3. We can prove that there is no public path to (static_ptr, static_type)
// above here.
const Iter e = __base_info + __base_count;
for (Iter p = __base_info; p < e; ++p)
{
// Zero out found flags
info->found_our_static_ptr = false;
info->found_any_static_type = false;
p->search_above_dst(info, current_ptr, current_ptr, public_path, use_strcmp);
if (info->search_done)
break;
if (info->found_any_static_type)
{
is_dst_type_derived_from_static_type = true;
if (info->found_our_static_ptr)
{
does_dst_type_point_to_our_static_type = true;
// If we found what we're looking for, stop looking above.
if (info->path_dst_ptr_to_static_ptr == public_path)
break;
// We found a private path to (static_ptr, static_type)
// If there is no diamond then there is only one path
// to (static_ptr, static_type) and we just found it.
if (!(__flags & __diamond_shaped_mask))
break;
}
else
{
// If we found a static_type that isn't the one we're looking
// for, and if there are no repeated types above here,
// then stop looking.
if (!(__flags & __non_diamond_repeat_mask))
break;
}
}
}
if (!does_dst_type_point_to_our_static_type)
{
// We found a dst_type that doesn't point to (static_ptr, static_type)
// So record the address of this dst_ptr and increment the
// count of the number of such dst_types found in the tree.