Merge pull request #834 from cubbimew/c131-constify

C.131: getters should be const member functions
This commit is contained in:
Gabriel Dos Reis 2017-01-30 06:59:27 -08:00 committed by GitHub
commit dd7275623d

View File

@ -6393,9 +6393,9 @@ A trivial getter or setter adds no semantic value; the data item could just as w
int y;
public:
Point(int xx, int yy) : x{xx}, y{yy} { }
int get_x() { return x; }
int get_x() const { return x; }
void set_x(int xx) { x = xx; }
int get_y() { return y; }
int get_y() const { return y; }
void set_y(int yy) { y = yy; }
// no behavioral member functions
};