As quoted by Stroustrup “C enumerations constitute a curiously half-baked concept” and very few modifications are done to rectify there shortfalls resulting in manifestation of silent behavioral changes. Let's check an example to support this,

I bet the validation in above case will not be true as enumMyInterval will never be treated as unsigned int (4294967295) and will be -1. And there is no way to make INTERVAL_4 point to unsigned int as it will default to int.

Keeping all these in mind, in C++11, we got what is called enum class - A Strongly typed enum.NOTE : VS2010 do not support this feature... hope they will support in VS2011.

Let us quickly glance the new syntax:

1. With C++11, the enumerators are no longer exported to surrounding scope and requires scope identifer

To handle certain scenarios the c++ compilers silently create at times temporaries that can serioulsy hit the performance of the code. With evolution of compilers, few of these temporary creations are arrested but many more slipped leading to relativley in-efficent programs. Let's see what I am saying:

If we analyze this code, GetNDimensionalVector( ) method created a vector say of 10 doubles which will require 10*sizeof(double) bytes. Now while returning a compiler (prior to VS03 for example) will again create a copy. However recent compilers fixed this hole (via Return value optimization - aka RVO). Now the call to GetNDimensionalVector( ) will copy all its content again to vecNewMatrix (upon which further operations are done) and the result of GetNDimensionalVector( ) call is evaporated as after ; as this is temporary. What a pitty!, we are wasting a lot of memory chunks instead of just pilfering the data inside the temporary vector into vecNewMatrix.

A smart language should allow this. And this is exactly what they have provided us through Rvalue reference.

The '&&' is the token identifies the reference as an "rvalue reference" and distinguishes it from the current (lvalue) reference '&'.

The implementation of move semantics significantly increases the performance as the resorurces of temporary object( that cannot be referenced elsewhere in the program as it is going to evaporate) can be pilfered instead of copying.To get better understanding take the case when a vector needs more capacity and if no continuos memory is available. Then it will identify a memory location which is large enough to hold its old contents plus required (new) capacity. It will then copy all the old contents to this new location. Now this call to copy construcutor is expensive if the contents are a 'string' or a heavy-duty class/structure. The pitty here is that all the old location contents will be evaporated. How nice it would be if this operation involves just stealing the old contents instead of copying.

Hope you got what I say.

Please note that - The copy operation leaves the source unchanged while a move operation on the other hand leaves the source either unchanged or it may be radically different. Now if a developer chooses Move operation upon an object, then he should no more care about the state of the source object [he should keep in mind that the source object's state is disturbed and is not more useful]. If his intention is still to use source along with duplicate then he should be doing copying (as is done till now) and not move.

The comments in the sample code above are pretty much self explanatory. Just note that for Move constructor and assigment operator we took the argument without const, as we intent to modify them (we want to set them to default once we moved their content to target)There are many more points that need to be grasped in this feature but those are out-of-scope on this introductory part. I will just cover one more scenario and wind up this section.

In the above example, MyFileStream class have default member types. What if the members are of some other class type say like MyString.

Perfect forwarding:Another nice effect of Rvalue implementation is the solution to the Forwarding problem.Before going any further,lets grasp this forwarding problem. Suppose we have two structures handling Licence operations one OpenLicence and another ClosedLicence and say suppose if we want to do some master check before creating the object for either these structures, then we can use a wrapper template function where we can do this master check and then simply pass (forward) the arguments to the stuctures.

Now what if the first argument is an Rvalue ( Licence_Wrapper( 007, key2 ) ) or what if both are Rvalues ( Licence_Wrapper( 006, 007 ); ) To handle these we should have that many overloads. More number of arguments leads to more number of overloads. Our code will be pumped with overloads to handle all these ..... Welcome to the forwarding problem.Rvalue refrences just solve this in one stroke

That's it. No more overloads needed any where. This is called PERFECT FORWARDING. Really perfect, isn't it. There are many more to discuss in this topic, but again as this in introductory article I won't cover them here.

long long is a 64-bit integer type. Previous to C++11, the largest interger type is long and it's size is platform (32 or 64) dependent. But this long long guarantees to be atleast 64-bit long. Actually this concept is accepted in C++99 and as many compilers already supported it, the C++11 committee gave a thumbs up for this new integral type.

Say suppose we have a base class with a virtual function. In any of it's derived classes this function can be overrided and no special keyword or annotation is needed upon this function to do so. To put more clarity and to say that we are overriding a base class function, C++11 introduced a new keyword called override. A declaration marked 'override' is only valid if there is a function to override. This feature is shipped into VS2010. Let's see an example,