c++11

http://en.wikipedia.org/wiki/C++11

  • auto time=11_ms; (auto config the variable type)
  • for(string s : vec) {} (range loops)
  • hashtables introduced (std::set and std::map are not hashtables, they are binary trees)
  • []{}() (lamabda)C++11 provides the ability to create anonymous functions, called lambda functions.[9] These are defined as follows:
    [](int x, int y) { return x + y; }
    
  • rvalues ( C++11 adds a new non-const reference type called an rvalue reference, identified by T&&. This refers to temporaries that are permitted to be modified after they are initialized, for the purpose of allowing “move semantics”. )
  • unique_ptr which is like smart pointers (shared_ptr) but has only one reference. It enables auto-delete when there is no pointer pointing to it. std::auto_ptr is deprecated.
  • variadic templates: Prior to C++11, templates (classes and functions) can only take a fixed number of arguments that have to be specified when a template is first declared. C++11 allows template definitions to take an arbitrary number of arguments of any type.
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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s