title: How exception-safe is std::tie?
body: <p><code>std::tie</code> returns a tuple of references, so you can do the following:</p>
  
  <pre><code>int foo, bar, baz;
  std::tie(foo, bar, baz) = std::make_tuple(1, 2, 3);
  </code></pre>
  
  <p>This is similar to <code>foo, bar, baz = (1, 2, 3)</code> in Python.</p>
  
  <p>What is supposed to happen if one of the assignments throws, as in the following example?</p>
  
  <pre><code>int foo = 1337;
  struct Bar {
      Bar&amp; operator=(Bar) { throw std::exception{}; }
  } bar;
  try {
      std::tie(foo, bar) = std::make_tuple(42, Bar{});
  } catch (std::exception const&amp;) {
      std::cout &lt;&lt; foo &lt;&lt; '\n';
  }
  </code></pre>
  
  <p>Will it print 1337 or 42, or is this unspecified?</p>