This is Work-In-Progress. Developing a series of lectures on C++0x. This will augment my presentations on C++ and Design Pattern. First trial run was done at Interra, Noida in 2009
88. nullptr: Example char* p = nullptr; int* q = nullptr; char* p2 = 0; // 0 still works and p==p2 void f(int); void f(char*); f(0); // call f(int) f(nullptr); // call f(char*) void g(int); g(nullptr); // error: nullptr is not an int int i = nullptr; // error nullptr is not an int if(n2 == 0); // evaluates to true if(n2 == nullptr); // error if(nullptr); // error, no conversion to bool if(nullptr == 0); // error
Maintain stability and compatibility don't break old code, and if you absolutely must, don't break it quietly. Prefer libraries to language extensions an ideal at which the committee wasn't all that successful; too many people in the committee and elsewhere prefer "real language features." Prefer generality to specialization focus on improving the abstraction mechanisms (classes, templates, etc.). Support both experts and novices novices can be helped by better libraries and through more general rules; experts need general and efficient features. Increase type safety primarily though facilities that allow programmers to avoid type-unsafe features. Improve performance and ability to work directly with hardware make C++ even better for embedded systems programming and high-performance computation. Fit into the real world consider tool chains, implementation cost, transition problems, ABI issues, teaching and learning, etc.
auto earlier was a storage class specifier for automatic variables.
The expression ((T)0) is a hackish way to write an expression that has the type T and doesn’t require T to be default constructible.
auto earlier was a storage class specifier for automatic variables.
auto earlier was a storage class specifier for automatic variables.
auto earlier was a storage class specifier for automatic variables.
Src: [N1377] A Proposal to Add Move Semantics Support to the C++ Language.mht