C++11 Features
Timothy_m
这个作者很懒,什么都没留下…
展开
-
auto
• auto is used to infer the type of the variable that is being declared and initialized • In ‘old’ C++: • In C++ 11: • Anyway,there are restrictions on its usage: • You cannot us翻译 2014-03-08 21:12:01 · 442 阅读 · 0 评论 -
std::function
• std::function is a STL template class that provides a very convenient wrapper to a simple function, to a functor or to a lambda expression. For example: • store several functions, functo翻译 2014-03-08 21:48:22 · 519 阅读 · 0 评论 -
nullptr
• In C and ‘old’C++ the null pointer is the preprocessor macro NULL. ( just a plain 0 ) • C++11 introduces nullptr; A keyword that unambiguously represents a pointer pointing to nowhere. ( std::n翻译 2014-03-08 20:06:32 · 666 阅读 · 0 评论 -
std::bind
• std::bind is a template function that returns a std::function object that binds a set of arguments to a function. • the std::bind receives a pointer to a function (it also can be a lambda expre翻译 2014-03-08 21:55:36 · 400 阅读 · 0 评论 -
decltype
•decltype is a new keyword that infers the type of a given expression •itis used mainly on return types For example: •decltypeto var: •decltypeto specify the return type: •decltypeto the templa翻译 2014-03-08 21:38:14 · 459 阅读 · 0 评论 -
Strongly Typed Enums
•TheC++ 11 solve the known problems with the traditional enums: •the scope of the enumerators •Implicit conversion to an integer •Inability to specify underlying type For exam翻译 2014-03-08 20:45:12 · 584 阅读 · 0 评论