변수나 클래스에 const로 중간에 변하지 않게 만드는 것이 실수를 줄여 안전성이 좋아진다
int a = 1; 같이 컴파일시간에 변수를 알면
constexpr int a = 1;로 선언하는 것이 좋다.
클래스에서 사용하는 경우는
class EXAMPLE {
public:
void setVector(const std::vector<int> & inputVec);
void printVec() const;
const std::string& getNameRef();
private:
std::string name;
}