title: Different behavior when trying to swap two variables using {} and std::make_pair()
body: <p>I was trying to swap two variables using <code>std::tie()</code> as per the following code (I am aware of <code>std::swap</code>, I was just trying this out of curiosity):</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;tuple&gt;
  
  using std::cin; using std::tie; 
  using std::cout; using std::endl;
  using std::make_pair;
  
  int main() {
      int a = 2, b = 10;
      cout &lt;&lt; "Before Swapping using {}" &lt;&lt; endl;
      cout &lt;&lt; "a: " &lt;&lt; a &lt;&lt; " b: " &lt;&lt; b &lt; &lt;endl;
      tie(a, b) = {b, a};
      cout &lt;&lt; "After Swapping using {}" &lt;&lt; endl;
      cout &lt;&lt; "a: " &lt;&lt; a &lt;&lt; " b: " &lt;&lt; b &lt;&lt; endl;
  
      a = 2, b = 10;
      cout &lt;&lt; "Before Swapping using make_pair()" &lt;&lt; endl;
      cout &lt;&lt; "a: " &lt;&lt; a &lt;&lt; " b: " &lt;&lt; b &lt;&lt; endl;
      tie(a, b) = make_pair(b, a);
      cout &lt;&lt; "After Swapping using make_pair()" &lt;&lt; endl;
      cout &lt;&lt; "a: " &lt;&lt; a &lt;&lt; " b: " &lt;&lt; b &lt;&lt; endl;    
  
      return 0;
  }
  </code></pre>
  
  <p>I compiled it using <code>g++ test.cpp -std=c++11 -o test</code>.</p>
  
  <p>But the output was this:</p>
  
  <pre><code>Before Swapping using {}
  a: 2 b: 10
  After Swapping using {}
  a: 10 b: 10
  Before Swapping using make_pair()
  a: 2 b: 10
  After Swapping using make_pair()
  a: 10 b: 2
  </code></pre>
  
  <p>So, my question is, since we can write <code>{a, b}</code> instead of writing <code>std::make_pair(a, b)</code> everytime (C++11 onwards), why are these two versions giving different output? </p>
  
  <p>My guess was that the following line </p>
  
  <pre><code>std::tie(a, b) = {b, a};
  </code></pre>
  
  <p>is not making a pair and for some reason only mutating the value of <code>a</code>. But I am not sure.</p>