c++ - 如何记录接受回调的函数?

标签 c++ doxygen

我正在编写一个异步库,我的一些方法将回调作为参数:

/// \brief Opens a connection to the remote server defined by the parameters passed in the constructor.
/// \param[in] callback Callback passed when the connection is estabelished or fails.
/// \return Any errors encountered by the library or the OS.
virtual connect(std::function<void(std::error_code ec)> callback) noexcept = 0;

如何在 Doxygen 中记录回调的参数?

最佳答案

您想要一种以嵌套方式(函数参数内的函数)记录仿函数本身的方法,但 Doxygen 不支持该 AFAIK。您可以使用 \parblock 手动完成还有一些Doxygen Markdown .另一种手动方法是将回调定义移动到 typedef 并用 \typedef 记录它。 ,这将再次需要手动操作,因为 Doxygen 不以这种方式支持仿函数。

关于c++ - 如何记录接受回调的函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54483956/

相关文章:

c - 如何检查 doxygen\return 语句的正确性?

documentation - 如何在 Doxygen 中使用与安装选项交互的条件

doxygen - Doxywizard 下一个按钮被禁用

c++ - 默认复制构造函数和复杂的继承层次

c++ - 帮助 C++ 中的类和成员变量

c++ - 正在运行的线程中的 cstatic 控件的 Redrawwindow

multithreading - Doxygen 很慢

CMake 错误 (configure_file) : configure_file error configuring file

c++ - 为什么从 Windows 启动时程序会运行而不是命令提示符?

c++ - 管道 boost::iostreams 没有任何输出