CONSTEXPR&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP: will be calculated at compile time Lambda: Yes version 98, 03 with operator () Local functor when creating a lambda function, the compiler internally generates such a functor and passes the parameters from its scope to the lambda function ################################################## ########################################## #__func__ : can only be used inside the function, Parameter not #pragma once = _pragma ("once") the difference is that one is a macro, one is the operator (pre-compilation period can also be used) #define &NBSP;PR (...) printf (__va_args__) __line__,__file__ only works in macro functions and does not work in normal functions __cplusplus macros are defined as a specific number, such as: 201103Llong long : printf lld llu Compile Period: Static_assert () noexcept () default Noexcept (TRUE), a function that does not declare noexcept, is a member of the default declaration noexcept (true) is initialized when defined. Equivalent to adding before the constructor exits initialization sizeof can calculate non-static members of a class friend can omit the class keyword or be applied to an alias that has been typedef can also be applied to template parameters final: Using the virtual interface cannot subclass rewrite override is the template default parameter that must be overridden:template<typename t = int > class Test{}; function template The position of the default parameter is notRestricted, template class default parameters refer to the default parameters of the function of the rule external template: function reference extern a variable, the usage is the same, that is declared in a header file extern template void test< Int> (); ############################################################################################ #类继承时, Subclasses want to use can using , this practice is called through, the pass can also be used in the subclass of the constructor, and only with a using can be passed through multiple overloaded constructor constructors may invoke other overloaded constructors: this practice is called delegation, The delegate constructor at this point is equivalent to a common function test (int i) try:m_i (i) {}catch (...). {} rvalue: Undesirable address, non-assignable change lifetime move forward: reference collapsed (with rules) in the class, there are more move constructors and move assignment functions {} Initialization everything is OK POD: compatible c,bool operator "" _c () inline namespaceusing Template aliases: using aa=vector<int>################################################ ############################################ #改进 >autodecltype used in paradigms, Decltype has derivation rules decltype will make const or valotile return type for failure tracking function:->typefor (auto e: ...) /// do not modify element content for (auto& e: ...) /// Modify element Contents for (const auto& e: ...) gcc compile it's right, ##################################.########################################################## #enum class type{}: Strongly typed enumeration value (does not allow stealth conversions) Delete [] nullptr:okunique_ptr,shared_ptr refer to the reference rvalue attribute for use, weak_ptr, only reference but not count, shared with shared_ptr ##################### ####################################################################### #编译时常量: constexpr variable length template:template < Typename ... element> class tuple;element: Template parameter Package implementation: Recursive Inheritance (template class inheritance), there are three step 1, normal variable length template declaration 2, recursive definition 3, Recursive end:template<> defined template class name { for inherited data member } variable-length template function, internal also to be recursive implementation sizeof ... (), computes the number of variable-length parameters multithreading cstdlib:atexit (exit registration function of C) c++11,at_quick_exit,at_exit##################### ####################################################################### #默认函数操作符operator, Operator&operator &&operator*operator->operator->*operator newoperator delete declares a constructor that causes non-pod=default= deletedlambda: // default is a Const function [] () mutable->return-type{}[var][=][&var][&]by_ref_lambda ref;by_val_lambda const;alignof,alginas
C++11 notes