通过 see 命令引用转换运算符



我在从源中的另一个点引用转换运算符时遇到麻烦,这是一个最小的例子:

#include <string>
/*!
  Dummy struct
 */
struct A
{
    /*!
      Dummy operator.
     */
    void operator()() const {}
    /*!
      Dummy conversion operator.
      return Nothing, really.
     */
    operator std::string() const { return std::string(); }
};
/*!
  Dummy function.
  see A::operator()()
  see A::operator std::string()
 */
void b()
{
    // Here I use A::operator() and A::operator std::string
    // so it would be nice to reference them in the docs.
}

函数中的第一个see命令有效b()结果是指向A运算符在 HTML 输出中,但第二个没有。

如何引用转换运算符?

似乎有效,使用"无用"的typedef,以便doxygen将string识别为A::string

/*!
  Dummy struct
 */
struct A
{
    typedef std::string string;
    /*!
      Dummy conversion operator.
      return Nothing, really.
     */
    operator string() const { return std::string(); }
};
/*!
  Dummy function.
  see A::operator string()
 */
void b();

最新更新