我曾经将简单的注释写到我的头文件中
// 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) { /* ... */ }
令人惊讶的是,当悬停此功能或获得视觉辅助“IntelliSense”时,我得到了两个不同的输出。悬停Replace
收益率
而提到的 IntelliSense 产生
但是将 Doxygen 样式注释移动到标题中会产生奇怪的结果
我想知道您是否有建议如何使用 Qt 样式的 doxygen 注释,但让 IntelliSense 显示适当的工具提示(无论它可能是什么),而不是根据我调用它的方式显示不同的工具提示? 必须有一种方法来统一这一点。(或者,我必须像往常一样工作并创建仅包含 doxygen 注释的单独文档标题 - 这样我不会有问题但会有冗余数据)