CPP OOP class property

Programming / cpp / learn cpp

const std::string& getName() const { return name_; }
void setName(std::string name) { name_ = std::move(name); }
1
2
3
4
5
6
7
struct Point {
private:
    int x_ = 0;
public:
    inline int x() const { return x_; }
    inline void x(int value) { x_ = value; }
};