http://blog.csdn.net/cnsword/article/details/8034947
Companies can use C++11. See Daniel's code imitation use, so now do not know what the use of C + + syntax or c++11 syntax ... I don't know if it's kind of sad.
C++11 has revised the keywords, added nullptr, constexpr, Decltype, default, Static_assert , and the original keywords (auto,using,extern ) meaning and purpose have been revised. Here's a look at the changes to auto, using, extern, three keywords.
Auto:
1 /*Automation Variables*/2Auto A = A;3Auto B =12.0f;4Auto C ="ABC"5Auto d = [] (intx)int{return A;}//See C + + article <c++lambda expressions >6Auto E = Std::bind (&func, _1);//See C + + articles <std::function and std::bind function pointers >7 8vector<int>s;9S.push_back (1);TenS.push_back (2); One for(Auto it = S.begin (); It! = S.end (); it++) A { -cout<<*it<<Endl; - } the - /*Delay Binding*//See article <c++11 of decltype> -Template<typename T, TypeName l> -Auto Fun (T x, L y)->decltype (x + y) {returnx;}
Using:
1 /*Defining aliases*/2template<classT>3 usingTlist = std::list<t>;4 5 usingTlist = std::list<Char>;6 Tlist Listchar;7 8 //typedef void (*DF) ()9 usingDF =void(*)();Ten One /*using external constructs*/ A usinga::a; - - /*referencing external types*/ the usingTypeName A;
extern
1 / * external template * /
2 extern template<class t>void(T t);
C++11 new meaning of the old keyword (auto, using,extern)