我曾经以以下的方式在我的头文件中写简单的注释:
// Returns a new string in which all occurrences of a specified string in the
// current instance are replaced with another specified string.
// - strSubject: The string to perform the replacement on.
// - strOldValue: The string to be replaced.
// - strNewValue: The string to replace all occurrences of strOldValue.
static RUNTIME_API String::type Replace
(_In_ String::type strSubject,
_In_ const String::type& strOldValue,
_In_ const String::type& strNewValue);
希望Visual Assist能够准确显示我这个注释:
目前,我正在考虑使用Doxygen为项目创建文档,但我在寻找正确显示在工具提示中并可被Doxygen解析的文档样式方面遇到了困难。首先,我考虑在*.cpp文件中包含Doxygen风格的注释,以便只显示标题注释。因此,在我的源文件中,我有一个类似于以下的注释:
/*!
* Returns a new string in which all occurrences of a specified string in the
* current instance are replaced with another specified string.
*
* \param strSubject The string to perform the replacement on.
* \param strOldValue The string to be replaced.
* \param strNewValue The string to replace all occurrences of strOldValue.
*
* \return A string that is equivalent to the current string except that all
* instances of strOldValue are replaced with strNewValue. If
* strOldValue is not found in the current instance, the method returns
* the current instance unchanged.
*/
String::type String::Replace
(_In_ String::type strSubject,
_In_ const String::type& strOldValue,
_In_ const String::type& strNewValue) { /* ... */ }
令人惊讶的是,在悬停此功能时或获取Visual Assists“IntelliSense”时,我会得到两个不同的输出。悬停
Replace
会产生如下结果:
而所提到的IntelliSense则产生以下结果:
然而,将Doxygen样式的注释移入标题中却有一个奇怪的结果:
我想知道您是否有建议,如何使用Qt样式的doxygen注释,但仍能让IntelliSense显示相应的工具提示(无论它是哪一个),而不是根据我如何调用它而显示不同的工具提示?必须有一种方法来统一这一切。(或者我要像往常一样工作,并创建仅由doxygen注释组成的单独文档头文件-这样我就不会遇到问题,但会有冗余数据)