CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Threaded View

  1. #1
    Join Date
    Dec 2008
    Posts
    91

    C++0x fails: no multiple return values

    I am kind of annoyed that C++0x doesn't support multiple return values as such:
    Code:
    int, int GetValues(int x, int y)
    {
       return (x), (y);
    }
    
    int main()
    {
       int x;
       int y;
       x,y = GetValues(1,2);
    }

    I mean, this is one of the most useful expansions that could be made to C++ and it is not added to C++0x?


    What do you guys think?


    PS: I don't need you to explain to me that I can make a function like
    Code:
    void GetValues(int x, int y, int &x, int &y)
    as this is just annoying to code (which is the problem).
    Last edited by poolisfun; May 23rd, 2010 at 03:32 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured