【问题标题】:Doxygen: How to reference a function, but with arguments valuesDoxygen:如何引用函数,但使用参数值
【发布时间】:2017-02-01 13:25:08
【问题描述】:

当我为这个类生成文档时:

class MyClass
{
    /** Some description
     * \param inhibit some description
     */
    virtual void inhibitSaving( bool inhibit = true ) = 0;

    /** \return true if @ref inhibitSaving with parameter set to true has been called previously */
    virtual bool isSavinginhibited() const = 0;
};

isSavinginhibited 的描述有一个指向inhibitSaving 的超链接。

但是,如果我写如下描述:

/** \return true if @ref inhibitSaving(true) has been called previously */
virtual bool isSavinginhibited() const = 0;

isSavinginhibited 的描述没有指向inhibitSaving 的超链接。

考虑到this discussion,它应该可以工作。为什么我没有得到超链接。我做错了什么?

【问题讨论】:

  • 看看讨论,你上面写的例子不在 Dimitri 给出的列表中(true 不是类型它的值)。您想要的似乎是 \ref inhibitorSaving(bool) "inhibitSaving(true)" 或 \ref inhibitorSaving "inhibitSaving(true)"
  • @ArturKink:你说得对,这行得通。您可能希望将此作为答案发布,以获得应得的声誉。

标签: c++ doxygen


【解决方案1】:

正如 ArturKink 所评论的,inhibitSaving(true) 不是有效的类型引用,只有 inhibitSaving(bool) 是。

所以链接应该由\ref inhibitSaving(bool) "inhibitSaving(true)"\ref inhibitSaving "inhibitSaving(true)"创建

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-23
    • 1970-01-01
    • 2011-10-24
    • 1970-01-01
    • 2020-03-14
    • 2015-10-27
    • 2011-12-09
    • 1970-01-01
    相关资源
    最近更新 更多