Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 329 Bytes

Constants_and_immutability.md

File metadata and controls

16 lines (14 loc) · 329 Bytes

Con: Constants and immutability

Table of contents

Con.2: By default, make member functions const

class Point{
  int x, y;
public:
  int getX() const{ // do
  int getX(){       // do not
    return x;
  }
}