【发布时间】:2011-01-24 11:09:29
【问题描述】:
我有一个在 myclass.hpp 中公开静态函数的类
class MyClass {
public:
static std::string dosome();
};
好吧,在 myclass.cpp 中我应该写什么: 这个:
std::string MyClass::dosome() {
...
}
或者这个:
static std::string MyClass::dosome() {
...
}
我想我不应该重复 static 关键字...对吗?
【问题讨论】:
-
不要重复静态关键字,但我很想知道原因
-
@MattSmith:请参阅下面的答案。
标签: c++ static-methods