title: Comparison (<), output (<<) and assignment (=) for boost::optional
body: <p>I have a few questions about how <code>boost::optional</code> works. Let's first do this:</p>
  
  <pre><code>boost::optional&lt;int&gt; i;
  </code></pre>
  
  <ol>
  <li>Is <code>i &lt; 3</code> always equivalent to <code>*i &lt; 3</code> (and similar for other relational operators)?</li>
  <li>Is it correct that the conditions <code>i &lt; 3</code> and <code>*i &lt; 3</code> are undefined? (<code>i</code> has still not been set to anything)</li>
  <li>What is <code>std::cout &lt;&lt; i</code> supposed to print?</li>
  <li>I'm pretty sure that <code>i = 3</code> is always the same as <code>*i = 3</code>. If so, which should I prefer?</li>
  </ol>