#include <iostream>
#include <string>
using namespace std;
class Rectangle {
int width, height;
public:
Rectangle (int x, int y) : width(x), height(y) {}
Rectangle () = default;
Rectangle (const Rectangle& other) = delete;
int area () {return width*height;}
};
int main(int argc, char const *argv[])
{
Rectangle foo;
Rectangle bar (10, 20);
cout << "bar's area: " << bar.area() << endl;
return 0;
}
c++中implicit members
最新推荐文章于 2022-11-12 21:57:49 发布