title: Name alias references for pair or tuple values
body: <p>When restructuring some code I came across a 'problem' when returning a struct with 2 values. Now these really should be named for the documented effect. Later on I wanted to use <code>tie</code> so i changed the struct into inheriting from <code>std::pair</code> and just setting references. Now this actually works fine, but you will notice now my struct has the size of 24 as opposed to just 8 compared to the pair. </p>
  
  <pre><code>#include &lt;tuple&gt;
  
  
  struct Transaction : public std::pair&lt;int, int&gt; {
      using pair::pair;
  
    int&amp; deducted = first;
    int&amp; transfered = second;
  };
  //static_assert(sizeof(Transaction) == sizeof(std::pair&lt;int, int&gt;));//commenting in this line will fail compilation
  
  Transaction makeTheTransaction();
  
  void test(int&amp; deduct, int&amp; transfer) {
      std::tie(deduct, transfer) = makeTheTransaction(); 
  }
  </code></pre>
  
  <p>The maybe obvious method is to change into member functions, however that is also too much 'boilerplate' for this case (then it just becomes easier not use <code>tie</code> later on). A direct memcpy is to eg. a tuple is straigt forward UB. A direct structured binding is also not doable since the variables is already in use.</p>
  
  <p>My question is what is a better or minimal code solution disregarding reusable parts (and given that the size shouldn't grow beyond the size of 2 ints) ?</p>
  
  <p>UPDATE: For this case I ended up just doing a plain struct and hold return in a temporary. For other users coming here, there is a library proposal to boost that seems to be able to convert any struct to tuple: <a href="https://github.com/apolukhin/magic_get/" rel="nofollow noreferrer">https://github.com/apolukhin/magic_get/</a></p>