Include-guards and commented out Doxygen comments affect the output of Doxygen

我只是一个虾纸丫 提交于 2020-01-17 05:55:51

问题


The behavior of Doxygen 1.8.11 for the following example is really bizarre:

File test.h:

/// \file

/// \namespace N1
/// Namespace N1.
namespace N1 {

#include "a.h"

} // namespace

int main() {
  return 0;
} 

File a.h:

/// \file

/// \namespace N1::N2
/// Namespace N2
namespace N2 {

#include "b.h"

} // namespace

File b.h:

/// \file

// class A does not appear without the commented Doxygen comments below!
// /// \cond None
#ifndef GUARD
#define GUARD
// /// \endcond

/// Class A
class A {};

// /// \cond None
#endif
// /// \endcond

The class A appears in the documentation of N1::N2 only if the include-guard in b.h is not present or is conditioned out. Interestingly, even having the conditioning comments commented out as in the example suffices to have the class A appear!

来源:https://stackoverflow.com/questions/40386042/include-guards-and-commented-out-doxygen-comments-affect-the-output-of-doxygen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!