title: C++ Static field access in the method
body: <p>How can I approach the months field in methods? The code in the constructor throws me an undefined reference to `CDate :: months'
  collect2.exe: error: ld returned 1 exit status</p>
  <pre class="lang-cpp prettyprint-override"><code>class CDate {
  public:
    CDate(int year, int month, int day);
    static constexpr const int months[] = {0,  31, 28, 31, 30, 31, 30,
                                           31, 31, 30, 31, 30, 31};
  
  private:
    int m_Year, m_Month, m_Day;
  };
  
  CDate::CDate(int year, int month, int day)
      : m_Year(year), m_Month(month), m_Day(day) {
    if (months[m_Month] != day)
      throw InvalidDateException();
  }
  </code></pre>