是否可以忽略 doxygen 生成的参考图中的“断言”离子?

Is it possible to ignore `assert`ions in doxygen generated reference graphs?

在我的代码中有一些 assert 调用来确保我的函数正常工作,并对数据结构进行一些不变测试。

有时我在 assert 的参数中使用函数,然后这个函数在该函数的 Doxygens 调用图中。对于一些更大的不变量测试,这确实污染了图表……

如何避免调用图中出现以下代码段中的 list_isSorted

int list_isElem (List l, Element e) {
  assert(list_isSorted(l));
  {
    if (list_isEmpty(l)) { return 0; }
    switch (compare(e, list_getValue(l))) {
    case -1: return 0;
    case  0: return 1;
    case  1: return list_isElem (list_getTail(l), e);
    default: exit(ERR_UNKNOWN);
    }
  }
}

我已经尝试在 Doxyfile 中设置 PREDEFINED = NDEBUG,但是没有用。

只是跳过断言?

见hhttp://www.doxygen.nl/manual/faq.html

"The new and easiest way is to add one comment block with a \cond command at the start and one comment block with a \endcond"

使用宏使其自动化:

#define DAssert(x) /** \cond */ assert(x) /** \endcond */