Learning C++11

(I am still updating this post, I am learning C++11 and this is my live blog post. There might be typos and bugs)

I have been hearing about the modern C++ and I feel that it is something that has a future. I mean C++ is already strong, it has survived for 30 years but when I code in C++ I need to use my brain cycles for stupid things. I need to think about data structures carefully but when I am working in something like Python I am free to get creative, I do not need to care about low level stuff. I can just code and hope that my code is going to run reletivley fast.

The new C++ seems to be pretty amazing. I am not just talking about the “auto” keywork and type inference. The lamba functions seem to be very useful and C++ now has things that were available in Java and C# from the beinning (remember for_each?). What I like to say is that C++ is now a

In this thread I will collect documents that can teach you and myself about the new C++. I will be a little careless about copyrights but nothing on this page is mine and I have just compiled it.

1- Watch the video, “Not your father’s C++” by our man Herb Sutter

2- Read Herb Sutter’s blog post “Elements of Modern C++ Style

3- Lambda Expressions

An example of lambda functions is on this page 

#include <iostream>

using namespace std;

int main()
{
    auto func = [] () { cout << "Hello world"; };
    func(); // now call the function
}

I use Visual Studio 2010 and Lambda functions already work in it. You may want to add #include “StdAfx.h” on top of your source for your code to work New Features The new features are summarized here

This is another good example of Lambda expressions “Using Lambda Expressions for Shorter, More Readable C++ Code

The wikipedia article for C++11 is relatively useful the only problem is that it does not highlight which features are already implemented in VS 2010 or 2011. For example constant expressions are not yet supported in Visual Studio (at least not in the 2010 version that I use)

TODO: add this on Modern C++ http://msdn.microsoft.com/en-us/library/hh279654(v=vs.110).aspx

http://www.cpprocks.com/wp-content/uploads/c++11-rocks-free-sample-lambdas.pdf

http://www.cpprocks.com/c11-a-visual-summary-of-changes/?goback=%2Egde_86998_member_124675384#!prettyPhoto

Learning C with gdb 

Advertisements

~ by marksalen on June 22, 2012.

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

 
%d bloggers like this: