title: How to use boost::error_info correctly?
body: <p>I'm trying to following the examples on this page:</p>
  
  <p><a href="http://www.boost.org/doc/libs/1_40_0/libs/exception/doc/motivation.html" rel="noreferrer">http://www.boost.org/doc/libs/1_40_0/libs/exception/doc/motivation.html</a></p>
  
  <p>The minute I try the following line:</p>
  
  <pre><code>throw file_read_error() &lt;&lt; errno_code(errno);
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>error C2440: '&lt;function-style-cast&gt;' : cannot convert from 'int' to 'errno_code'
  </code></pre>
  
  <p>How do I get this to work??</p>
  
  <p>Ideally I want to create something like this:</p>
  
  <pre><code>typedef boost::error_info&lt;struct tag_HRESULTErrorInfo, HRESULT&gt; HRESULTErrorInfo;
  </code></pre>
  
  <p>But I can't even get the first examples to work.</p>
  
  <p><strong>Edit: Here is a brief example of what generates error C2440 for me:</strong></p>
  
  <pre><code>struct exception_base: virtual std::exception, virtual boost::exception { };
  struct io_error: virtual exception_base { };
  struct file_read_error: virtual io_error { };
  
  typedef boost::error_info&lt;struct tag_errno_code,int&gt; errno_code;
  
  void foo()
  {
      // error C2440: '&lt;function-style-cast&gt;' : cannot convert from 'int' to 'errno_code'
      throw file_read_error() &lt;&lt; errno_code(errno);
  }
  </code></pre>