Visual Studio 2008- C++ actual and Beyond

I’m just back from an Community Event in Bad Homburg, were Boris Jabes from Visuals Studio  and ++ Compiler Team had digging into brand new feature pack TR1 and MFC updates. Were quite a lot of interesting stuff, mostly known from beta version, but quite few were quite hype.

As first example – tuple function, How often in the field development we have needs as one function to have more then one return values, ok, you may said, you pass them byvalue parameters, but that’s not what an real c++ guy does, right, so here  comes the "new" – Tuple.

   1: int x; double y;
   3:  
   4: x, y = DoSomething();

An follow the code that is the TR1 Support in the new Visual C++ 2008 Feature Pack. for this purpose.

   1: #include <iostream>
   2: #include <tuple>
   3:  
   5: using namespace std;
   6: using namespace tr1;
   7:  
   8: tuple<int, double> DoSomething()
   9: {
  10:     int x = 10;
  11:     double y = 20.0;
  12:     return make_tuple(x,y);
  13: }
  16: int _tmain(int argc, _TCHAR* argv[])
  17: {
  18:     int x;
  19:     double y;
  20:  
  21:     tie( x, y ) = DoSomething();
  22:  
  23:     cout << x << endl;
  24:     cout << y << endl;
  25:     
  26:     return 0;
  27: }

Return value it is as tuple defined (line8) and with tie function(line 21) to the right values assigned.

Other things, quite alot, VS 2008 is cool but what’s next will be hype, at least from c++ dev. vision .

http://msdn2.microsoft.com/en-us/teamsystem/bb725993.aspx

so keep learning and improve c++ , future is passion 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s