title: Is it possible to convert a boost::system::error_code to a std:error_code?
body: <p>I want to replace external libraries (like boost) as much as possible with their equivalents in standard C++ if they exist and it is possible, to minimize dependencies, therefore I wonder if there exists a safe way to convert <code>boost::system::error_code</code> to <code>std::error_code</code>. Pseudo code example:</p>
  
  <pre><code>void func(const std::error_code &amp; err)
  {
      if(err) {
          //error
      } else {
          //success
      }
  }
  
  boost::system::error_code boost_err = foo(); //foo() returns a boost::system::error_code
  std::error_code std_err = magic_code_here; //convert boost_err to std::error_code here
  func(std_err);
  </code></pre>
  
  <p>The most important it is not the exactly the same error, just so close to as possible and at last if is an error or not. Are there any smart solutions?</p>
  
  <p>Thanks in advance!</p>