我有一个静态类,它有几个函数调用的方法。因为我不能将它们作为私有函数添加到头文件中,而且我不希望它们在类之外被看到,所以我在cpp文件中对它们进行了编码。我的问题是,因为我必须编写项目的文档,无论如何,我可以将这些函数添加到标题中吗? (如果不是编码解释,我不喜欢在cpp中编写文档)。头文件中的静态类方法声明C++
例如:
MyStaticClass.h
class MyStaticCLass{
public:
/**
* I can write the doc here :D
*/
static void myFunction();
}
MyStaticClass.cpp
void MyStaticClass::myFunction(){
myMethod1();
myMethod2();
}
/**
*I want to write the doc of this function but in the header
*/
void myMethod1(){
//do something 1
}
/**
*I want to write the doc of this function but in the header
*/
void myMethod2(){
// do something 2
}
没有“静态类”这样的事情。 –
将代码放在'details'命名空间中。按照惯例,任何内容都可以被视为不应该使用实现细节。 – NathanOliver
@PeteBecker静态类:只有静态函数的类?因为这个问题不能理解这个问题?我可以改变:) –