Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我认为这是因为我在下面编写的代码。但我无法解决。
classname::smt() {;} classname::smt1(int x, double y, string name) { x = xprivate; y = yprivate; name = nameprivate; }
这意味着您不能拥有执行此操作的代码:
class classname { classname() const classname() volatile classname() const volatile };
cv 限定符适用于存储和方法,而不是构造函数或析构函数(因为您仍然必须初始化 cv 限定存储)。