title: When to catch boost::bad_lexical_cast
body: <p>From the <a href="http://www.boost.org/doc/libs/1_43_0/libs/conversion/lexical_cast.htm" rel="nofollow noreferrer">documentation on the boost site for lexical cast</a> it states that when converting from a numeric type to a string type the conversion can throw a bad_lexical_cast. Clearly in this case we should always handle this exception should it be thrown.</p>
  
  <p>My question is, what about the other way around, going from a numeric type to a string? This is less risky on operation but it does not state on the boost documentation whether this operation can throw a bad_lexical_cast although the example given ommits the catch block.</p>
  
  <pre><code>log_message("Error " + boost::lexical_cast&lt;std::string&gt;(yoko) + ": " + strerror(yoko));
  </code></pre>
  
  <p>Should I be catching a potential exception when converting from a numeric type to a string?</p>