本文整理汇总了C++中Dsymbol::oneMember方法的典型用法代码示例。如果您正苦于以下问题:C++ Dsymbol::oneMember方法的具体用法?C++ Dsymbol::oneMember怎么用?C++ Dsymbol::oneMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dsymbol
的用法示例。
在下文中一共展示了Dsymbol::oneMember方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oneMembers
int Dsymbol::oneMembers(Dsymbols *members, Dsymbol **ps)
{
//printf("Dsymbol::oneMembers() %d\n", members ? members->dim : 0);
Dsymbol *s = NULL;
if (members)
{
for (size_t i = 0; i < members->dim; i++)
{ Dsymbol *sx = (*members)[i];
int x = sx->oneMember(ps);
//printf("\t[%d] kind %s = %d, s = %p\n", i, sx->kind(), x, *ps);
if (!x)
{
//printf("\tfalse 1\n");
assert(*ps == NULL);
return FALSE;
}
if (*ps)
{
if (s) // more than one symbol
{ *ps = NULL;
//printf("\tfalse 2\n");
return FALSE;
}
s = *ps;
}
}
}
*ps = s; // s is the one symbol, NULL if none
//printf("\ttrue\n");
return TRUE;
}
示例2: oneMembers
bool Dsymbol::oneMembers(Dsymbols *members, Dsymbol **ps, Identifier *ident)
{
//printf("Dsymbol::oneMembers() %d\n", members ? members->dim : 0);
Dsymbol *s = NULL;
if (members)
{
for (size_t i = 0; i < members->dim; i++)
{
Dsymbol *sx = (*members)[i];
bool x = sx->oneMember(ps, ident);
//printf("\t[%d] kind %s = %d, s = %p\n", i, sx->kind(), x, *ps);
if (!x)
{
//printf("\tfalse 1\n");
assert(*ps == NULL);
return false;
}
if (*ps)
{
assert(ident);
if (!(*ps)->ident || !(*ps)->ident->equals(ident))
continue;
if (!s)
s = *ps;
else if (s->isOverloadable() && (*ps)->isOverloadable())
{
// keep head of overload set
FuncDeclaration *f1 = s->isFuncDeclaration();
FuncDeclaration *f2 = (*ps)->isFuncDeclaration();
if (f1 && f2)
{
assert(!f1->isFuncAliasDeclaration());
assert(!f2->isFuncAliasDeclaration());
for (; f1 != f2; f1 = f1->overnext0)
{
if (f1->overnext0 == NULL)
{
f1->overnext0 = f2;
break;
}
}
}
}
else // more than one symbol
{
*ps = NULL;
//printf("\tfalse 2\n");
return false;
}
}
}
}
*ps = s; // s is the one symbol, NULL if none
//printf("\ttrue\n");
return true;
}
示例3: oneMembers
int Dsymbol::oneMembers(Dsymbols *members, Dsymbol **ps, Identifier *ident)
{
//printf("Dsymbol::oneMembers() %d\n", members ? members->dim : 0);
Dsymbol *s = NULL;
if (members)
{
for (size_t i = 0; i < members->dim; i++)
{ Dsymbol *sx = (*members)[i];
int x = sx->oneMember(ps, ident);
//printf("\t[%d] kind %s = %d, s = %p\n", i, sx->kind(), x, *ps);
if (!x)
{
//printf("\tfalse 1\n");
assert(*ps == NULL);
return FALSE;
}
if (*ps)
{
if (ident)
{
if (!(*ps)->ident || !(*ps)->ident->equals(ident))
continue;
}
if (!s)
s = *ps;
else if (s->isOverloadable() && (*ps)->isOverloadable())
; // keep head of overload set
else // more than one symbol
{ *ps = NULL;
//printf("\tfalse 2\n");
return FALSE;
}
}
}
}
*ps = s; // s is the one symbol, NULL if none
//printf("\ttrue\n");
return TRUE;
}