1 / 22

CPP 0x 标准新特性

CPP 0x 标准新特性. 西安邮电学院 西邮Linux兴趣小组 2011.3. 崭新的CPP,智能的编程,更多的生活!. WARNING. 本PPT仅作为讲解的辅助表现,讲解内容不仅仅包含于所示内容。 所示内容仅作为普通的了解,不作为深刻讨论,可以共同研究深切原因~ (= =|||) 还包括的讨论问题: 1.你在迷茫什么?我在学些什么?我去学些什么? 2.如何开始自己的一个项目? 以上 均为个人观点~~. 泛化 常数表示式. POD简介 什么是常数表达式? 什么泛化的常数表达式?. int GetOne(void) {   return 1; }

Download Presentation

CPP 0x 标准新特性

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPP 0x 标准新特性 西安邮电学院 西邮Linux兴趣小组 2011.3

  2. 崭新的CPP,智能的编程,更多的生活!

  3. WARNING 本PPT仅作为讲解的辅助表现,讲解内容不仅仅包含于所示内容。 所示内容仅作为普通的了解,不作为深刻讨论,可以共同研究深切原因~ (= =|||) 还包括的讨论问题: 1.你在迷茫什么?我在学些什么?我去学些什么? 2.如何开始自己的一个项目? 以上 均为个人观点~~

  4. 泛化常数表示式

  5. POD简介 什么是常数表达式? 什么泛化的常数表达式?

  6. int GetOne(void) {   return 1; } int some_value[GetFive() + 5];

  7. Auto关键字

  8. Auto 在 C 中的作用是什么? Auto 起到他实际的作用了么? Auto 在新的CPP中他有着什么样子的作用? 动态语言 特性是什么?

  9. auto a = 9; auto b = “asdf”; auto c = 10.24; auto int d = 9; auto int e; auto e;

  10. Lambda 表达式

  11. 什么是Lambda表达式?(what) 使用Lambda 表达式 、函数有什么样子的好处?(why) 如何使用 Lambda 函数?(How) 在什么情况使用 Lambda 表达式?(where)

  12. 右值引用

  13. 左值引用与右值引用 移动语义 完美转发

  14. 移动构造

  15. 扩展初始化列表

  16. #include <initializer_list> struct C { //initialize C with doubles C(std::initializer_list<double>); }; // 用法 C c1={1.5,0.99,23.45,-1.87};

  17. template<typename T> class initializer_list { //private data members: a pointer + size, or two pointers public: //constructors: constexpr initializer_list(const T*, const T*); //[first,last) constexpr initializer_list(const T*, int);//[first,first+size) //accessing the range constexpr int size() const; //number of elements constexpr const T* begin() const; //first element constexpr const T* end() const; //one-past-the-last element };

  18. 变参模板

  19. template<typename T> void print_comma_separated_list(T&& value) { std::cout<<value<<std::endl; } template<typename First,typename ... Rest> void print_comma_separated_list(First&& first,Rest&& ... rest) { std::cout<<first<<","; print_comma_separated_list(rest...); }

  20. 编译器支持

  21. Gcc Sun C++ Intel C++ MSVC C++ Builder IBM XLC++ EDG eccp HP aCC

  22. 结束语与后话

More Related