authors: irvin franco dongo escalante ([email protected])[email protected] oscar israel...
TRANSCRIPT
Authors:Irvin Franco Dongo Escalante
([email protected])Oscar Israel Medina Velazco
Institution:Catholic University San Pablo
Original work by: C++ Committe
1Irvin Dongo - Israel Medina
Index: • Introduction
• Motivation
• Improvements
• Conclusion
2Irvin Dongo - Israel Medina
Introduction
C++0X is a new standard who will replace the C++98 and C++03 from the ISO/IEC 14882
3Irvin Dongo - Israel Medina
Motivation
• Add new features to the language • Improve c++ to make easier the design of systems
• Increase security of data and improve old techniques
• Increase the hability of working directly with hardware and
performance
4Irvin Dongo - Israel Medina
Motivation
• Make c++ easier to understand but robust at the same time • Improve the core of the language
5Irvin Dongo - Israel Medina
Improvements
• Garbage collector • Extern template
extern template class std::vector<MyClass>; libraries:• Hash Tables • Regular Expressions • General Purpose Smart Pointers • Extensible Random Number Facility • Mathematical Special Functions
6Irvin Dongo - Israel Medina
Improvements
• Concepts Container, Predicate..
• Range-based for-loopo int my_array[5] = {1, 2, 3, 4, 5}; for(int& x : my_array) { x *= 2; }
7Irvin Dongo - Israel Medina
Improvements
• Lambda Function [ ](int x, int y) { return x + y; }
std::for_each(some_list.begin(), some_list.end(), [&total](int x)) { total += x;}
• Object construction
class SomeType { int number; public: SomeType(int new_number) : number(new_number) {} SomeType() : SomeType(42) {} };
8Irvin Dongo - Israel Medina
Unrestricted unions
struct Point { Point() {} Point(int x, int y): x_(x), y_(y) {} int x_, y_; }; union U { int z; double w; Point p; U() { new( &p ) Point(); }
};
9Irvin Dongo - Israel Medina
New string literals
u8"I'm a UTF-8 string." u"This is a UTF-16 string." U"This is a UTF-32 string."Type long long int
Static assertionsstatic_assert ((3.14 < GREEKPI) && (GREEKPI < 3.15), "GREEKPI is inaccurate!");
sizeof
struct SomeType { OtherType member; }; sizeof(SomeType::member)
10Irvin Dongo - Israel Medina
Default and deletestruct NonCopyable { NonCopyable & operator=(const NonCopyable&) = delete; NonCopyable(const NonCopyable&) = delete; NonCopyable() = default; };Thread-local storage
Multitasking memory model
11Irvin Dongo - Israel Medina
Conclusions
• C++0X looks for a friendly environment for beginners • This standard is still incomplete and we expect more news
about it • It adds new tools and options to improve the design of
systems• C++0X Also accept sintax that in previous standards could
show errors
12Irvin Dongo - Israel Medina
Authors:Irvin Franco Dongo Escalante
([email protected])Oscar Israel Medina Velazco
Institution:Catholic University San Pablo
Original work by: C++ Committe
13Irvin Dongo - Israel Medina
Authors:Irvin Franco Dongo Escalante
([email protected])Oscar Israel Medina Velazco
Institution:Catholic University San Pablo
Original work by: C++ Committe
14Irvin Dongo - Israel Medina