title: How do I set fields in Thrift struct properly in C++ sources?
body: <p>I notice there is a method named <code>__set_FIELD</code> in the generated C++ class <code>MyThriftStruct</code> of my thrift structure <code>MyThriftStruct</code>. Calling this method will set the attribute <code>MyThriftStruct.__is_set.FIELD</code> to true which tells the structure this field has been set.</p>
  
  <p>I also notice that in the <a href="https://thrift.apache.org/tutorial/cpp" rel="nofollow">official tutorial</a> they set the filed of thrift structure by directly copying the value:</p>
  
  <pre><code>MyThriftStruct.FIELD = val;
  </code></pre>
  
  <p>The first method seems ugly but the latter one didn't change the <code>__isset</code> flag. So which one should I use to set the field of thrift struct in C++?</p>