![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++11/14探索
__如影随行
这个作者很懒,什么都没留下…
展开
-
C++11/C++14 (一)INITIALIZER_LIST
ps:以下代码 在VS2015编译通过~~~#include #include using namespace std;class CInitialTest{public:CInitialTest(const initializer_list& _list){for (auto i : _list){m_num.push_back(i);原创 2017-10-18 17:11:10 · 205 阅读 · 0 评论 -
C++11/C++14 (二)UNIFORM_INITIALIZATION
PS:以下代码在vs2015编译通过~~~#include #include using namespace std;//With C++11, everything can be initialized in much the same way.//Examples://1.Initialization of dynamically allocated a原创 2017-10-18 17:37:27 · 426 阅读 · 0 评论 -
C++11/C++14 (三)TYPE INFERENCE (AUTO) AND RANGE-BASED FOR LOOP
PS:以下代码在VS2015中编译通过~~~#include #include using namespace std;//Type Inference(auto)//In C++03, we must specify the type of an object when we declare it. //Now, C++11 lets us declare原创 2017-10-18 18:07:58 · 260 阅读 · 0 评论 -
C++11/C++14 (四)THE NULLPTR AND STRONG TYPED ENUMERATIONS
PS:以下代码在VS2015中编译通过~~~1.nullptr 在c++中,NULL被视为(void*)(0) or 0;因此NULL为参数时,可能会导致重载函数调用时不是预期想要的。如下:main函数中调用foo(NULL),实际上调用的是foo(int),而不是foo(char*)void foo(char*){cout }void foo(int)原创 2017-10-19 09:32:14 · 199 阅读 · 0 评论 -
C++11/C++14 (五)STATIC ASSERTIONS AND CONSTRUCTOR DELEGATION
PS:以下代码在VS2015编译通过~~~1. Static assertions 在程序编译期间进行断言判断The static_assert declaration tests a software assertion at compile time. This can be especially useful for template code.syntax looks原创 2017-10-19 10:11:14 · 242 阅读 · 0 评论