title: About returning more than one value in C/C++/Assembly
body: <p>I have read some questions about returning more than one value such as <a href="https://stackoverflow.com/questions/29457319/what-is-the-reason-behind-having-only-one-return-value-in-c-and-java">What is the reason behind having only one return value in C++ and Java?</a>, <a href="https://stackoverflow.com/questions/321068/returning-multiple-values-from-a-c-function">Returning multiple values from a C++ function</a> and <a href="https://softwareengineering.stackexchange.com/questions/203471/why-do-most-programming-languages-only-support-returning-a-single-value-from-a-f">Why do most programming languages only support returning a single value from a function?</a>.</p>
  <p>I agree with most of the arguments used to prove that more than one return value is not strictly necessary and I understand why such feature hasn't been implemented, but I still can't understand why can't we use multiple caller-saved registers such as ECX and EDX to return such values.</p>
  <p>Wouldn't it be faster to use the registers instead of creating a Class/Struct to store those values or passing arguments by reference/pointers, both of which use memory to store them? If it is possible to do such thing, does any C/C++ compiler use this feature to speed up the code?</p>
  <h1>Edit:</h1>
  <p>An ideal code would be like this:</p>
  <pre><code>(int, int) getTwoValues(void) { return 1, 2; }
  
  int main(int argc, char** argv)
  {
      // a and b are actually returned in registers
      // so future operations with a and b are faster
      (int a, int b) = getTwoValues();
      // do something with a and b
      
      return 0;
  }
  </code></pre>