title: C++; Is this the proper way to ensure proper data member initialization?
body: <p>I have a constructor for:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>class Student{
      string name;
      string last_name;
      unsigned score;
  ...
  </code></pre>
  
  <pre class="lang-cpp prettyprint-override"><code>   Student(string, string, int);
  
  // Student.cpp
  
  Student::Student(string name, string last_name, int score) : name(name), last_name(last_name)/
  ,score( score &lt;= 0 ? 1 : score) {} // notice the 'score' initialization.
  </code></pre>
  
  <p>I wanted to make sure the input of e.g. Student s("name", "last", -1); does not mess the whole thing, since student scores are in interval of [1 , 5] and score being of 'unsigned' data type.
  It really doesn't matter what type score is, I could've put it as 'int' or 'int8_t' (for memory saving) to resolve the problem but I wanted to know if there is a better way to do this?</p>
  
  <p>Thanks ppl :)</p>