title: Is there an alternative to suppressing warnings for unreachable code in the xtree?
body: <p>When using the std::map with types that use trivial, non-throwing, copy constructors, a compiler warning/error is thrown (warning level 4, release mode) for unreachable code in xtree. This is because the std::map has a try-catch in it that helps maintain the state of the tree in the case of an exception, but the compiler figures out that the catch statement will never be called if the stored elements don't throw. These warnings can be easily suppressed with the following lines at the top of the .cpp file: </p>
  
  <pre><code>#pragma warning(push)
  #pragma warning(disable:4702)
  #include &lt;xtree&gt;
  #pragma warning(pop)
  </code></pre>
  
  <p>Is there a way to bypass this warning/error without changing the warning level, building in debug, suppressing the warning, or using a different type in the map? Is there plans to change this in the standard library?</p>
  
  <p>Update:<br>
  Maybe it is compiler specific. I am using vc7. 
  The error is below:</p>
  
  <p><em>c:\program files\microsoft visual studio .net 2003\vc7\include\xtree(1116) : error C2220: warning treated as error - no 'object' file generated<br>
  c:\program files\microsoft visual studio .net 2003\vc7\include\xtree(1116) : warning C4702: unreachable code</em></p>
  
  <p>Apparently the xtree is used by the std::map.</p>