本文整理汇总了C++中TypeFunction::modifiersApply方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeFunction::modifiersApply方法的具体用法?C++ TypeFunction::modifiersApply怎么用?C++ TypeFunction::modifiersApply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeFunction
的用法示例。
在下文中一共展示了TypeFunction::modifiersApply方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ErrorExp
//.........这里部分代码省略.........
goto Ldimerror;
RootObject *o = (*e->args)[0];
Dsymbol *s = getDsymbol(o);
Type *t = isType(o);
TypeFunction *tf = NULL;
if (s)
{
if (FuncDeclaration *f = s->isFuncDeclaration())
t = f->type;
else if (VarDeclaration *v = s->isVarDeclaration())
t = v->type;
}
if (t)
{
if (t->ty == Tfunction)
tf = (TypeFunction *)t;
else if (t->ty == Tdelegate)
tf = (TypeFunction *)t->nextOf();
else if (t->ty == Tpointer && t->nextOf()->ty == Tfunction)
tf = (TypeFunction *)t->nextOf();
}
if (!tf)
{
e->error("first argument is not a function");
goto Lfalse;
}
Expressions *mods = new Expressions();
PushAttributes pa;
pa.mods = mods;
tf->modifiersApply(&pa, &PushAttributes::fp);
tf->attributesApply(&pa, &PushAttributes::fp, TRUSTformatSystem);
TupleExp *tup = new TupleExp(e->loc, mods);
return tup->semantic(sc);
}
else if (e->ident == Id::allMembers || e->ident == Id::derivedMembers)
{
if (dim != 1)
goto Ldimerror;
RootObject *o = (*e->args)[0];
Dsymbol *s = getDsymbol(o);
ScopeDsymbol *sds;
if (!s)
{
e->error("argument has no members");
goto Lfalse;
}
Import *import;
if ((import = s->isImport()) != NULL)
{
// Bugzilla 9692
sds = import->mod;
}
else if ((sds = s->isScopeDsymbol()) == NULL)
{
e->error("%s %s has no members", s->kind(), s->toChars());
goto Lfalse;
}
// use a struct as local function
struct PushIdentsDg
{