如何在Doxygen评论中加入'<'?

Jon*_*age 9 doxygen documentation-generation visual-studio-2008

假设我正在使用DOxygen/Visual studio兼容注释记录成员函数,如何在不创建编译器警告的情况下使用小于'<'的符号,但仍保持代码库中的可读性?

例如,如果我这样做:

    /// <summary>
    /// Verifies x < y
    /// </summary>
    bool VerifyIsLessThan(float x, float y);
Run Code Online (Sandbox Code Playgroud)

编译器说:

1>c:\MyProject\VerificationLib.h(246) : warning C4635: XML document comment applied to 'VerificationLib.VerifyIsLessThan(System.Single,System.Single)': badly-formed XML: Whitespace is not allowed at this location.
Run Code Online (Sandbox Code Playgroud)

有没有办法逃脱这种方式,使其在代码库和Doxygen生成的文档中仍然可读?

[编辑]

我开始认为这更像是视觉工作室方面而不是Doxygen.我们使用的形式应该适用于两者.原始问题中提到的警告来自visual studio而不是Doxygen.

深入挖掘它看起来像直接不支持逐字?

ris*_*ess 7

只是使用\<,应该是它. http://www.stack.nl/~dimitri/doxygen/commands.html#cmdlt

  • theres [doxygen]中的公式(http://www.stack.nl/~dimitri/doxygen/formulas.html).我从来没有使用它们,但看起来它仍然需要逃避<. (2认同)
  • 我认为您对 DOxygen 公式的看法是正确的,但即使我使用“\”或“@”符号对其进行转义,我也找不到任何方法使 MS XML 文档理解“&lt;”字符。唯一接近的是“&lt;”,但在代码库中看起来很糟糕。 (2认同)