是否可以在不重写派生类中记录虚拟成员?
Can I document a virtual member in a derived class without overriding it?
假设我有一些外部库,其中包含一个未记录的基类:
class Base {
public:
virtual void func() { /* something */ }
}
在我的库中,我想从这个类派生,并记录所有成员:
class Derived : public Base {
/*!
@brief do a thing
*/
void other_func();
/*!
@brief do the base thing and another thing
*/
void func(int arg);
/*!
@brief do the baseclass thing
Also, guarantee some extra invariants XYZ that the baseclass
does, but does not require subclassers to do.
*/
using Base::func;
// virtual void func() override;
// don't want to declare a new implementation of func() here
// so how can I attach a docstring to func() such that doxygen picks up on it?
}
如何在Derived.h
中记录继承的Base::func
?
使用 @fn 标签。您可以使用该标签并指定函数签名,然后该块的其余部分将分配给该函数。
对不起,我会举一个例子,但在电话里。
我会链接到官方文档,但令人沮丧,有点讽刺的是,doxygen的参考网站在移动设备上不起作用。所以只是谷歌它。
相关文章:
- 虚拟成员函数的定义是否强制在同一转换单元中动态初始化静态数据成员?
- 钻石继承虚拟成员铸造与指针
- 如果我必须覆盖非虚拟成员函数怎么办
- c++\CLI dll包装器,用于调用c++类中的虚拟成员
- 非虚拟成员函数是否可以使用模板参数?
- 如何将已实现的虚拟成员函数作为参数传递
- 调用虚拟成员类的方法
- 睡眠影响 std::thread 调用哪个虚拟成员函数?
- GTEST:嘲笑非虚拟成员函数
- 使SDL称为纯虚拟成员作为事件回调
- 在C中使用具有虚拟成员(即非POD)的C++结构
- 虚拟和非虚拟成员函数的调用方式有什么区别?
- 默认情况下是虚拟成员函数
- 是否可以在不重写派生类中记录虚拟成员?
- 为什么在已删除的指针上调用非虚拟成员函数是未定义的行为
- C++标准是否保证了没有虚拟成员函数的类类型的大小
- 使用虚拟成员从课堂制作 POD
- C++合成的move构造函数如何受到volatile和虚拟成员的影响
- 指向虚拟成员功能
- 在非构造"object"上调用非虚拟成员函数是否定义良好?