本文整理汇总了C++中QualifiedType::typeParam方法的典型用法代码示例。如果您正苦于以下问题:C++ QualifiedType::typeParam方法的具体用法?C++ QualifiedType::typeParam怎么用?C++ QualifiedType::typeParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QualifiedType
的用法示例。
在下文中一共展示了QualifiedType::typeParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: forType
QualifiedType AmbiguousTypeParamType::forType(QualifiedType base, const Type * match,
unsigned paramIndex) {
base = dealias(base);
match = dealias(match);
switch (base->typeClass()) {
case Type::Class:
case Type::Struct:
case Type::Interface:
case Type::Protocol: {
const CompositeType * ctBase = static_cast<const CompositeType *>(base.type());
if (const CompositeType * ctMatch = dyn_cast_or_null<CompositeType>(match)) {
if (ctMatch != NULL) {
base = ctBase->findBaseSpecializing(ctMatch);
if (!base) {
return QualifiedType();
}
}
if (paramIndex >= base->numTypeParams()) {
return QualifiedType();
} else {
return base->typeParam(paramIndex);
}
}
return QualifiedType();
}
case Type::NAddress:
case Type::NArray:
case Type::FlexibleArray: {
if (paramIndex == 0 && (match == NULL || base->typeClass() == match->typeClass())) {
return base->typeParam(0);
}
return QualifiedType();
}
case Type::Tuple: {
if (match != NULL || paramIndex >= base->numTypeParams()) {
return QualifiedType();
} else {
return base->typeParam(paramIndex);
}
}
case Type::AmbiguousParameter:
case Type::AmbiguousResult:
case Type::AmbiguousTypeParam:
case Type::AmbiguousPhi:
case Type::Assignment: {
QualifiedTypeSet expansion;
base.expand(expansion);
if (expansion.size() == 1) {
return forType(*expansion.begin(), match, paramIndex);
}
return new AmbiguousTypeParamType(base, match, paramIndex);
}
default:
return QualifiedType();
}
}