C++11???????????????????
???????????? ???????[ 2016/6/22 11:01:48 ] ??????????????????? .NET
?????????????new???????????????б???????
????vector<int> *pv = new vector<int>{0?? 1?? 2?? 3?? 4};
????int *pi = new int[5]{0?? 1?? 2?? 3?? 4};
????cout<<"test new alloator using list initialization: "<<(*pv)[2]<<' '<<pi[2]<<endl;
????????????????/??????????????б???????
m1.insert({"d"?? "D"});
vector<string> error_msg(int typ)
{
switch(typ)
{
case 1:
return {"type1"?? "msg1"};
case 2:
return {"type2"?? "msg2"};
default:
return {};
}
}
pair<string?? string> get_pair(int typ)
{
if(typ == 1) return {"key"?? "value"};
return pair<string?? string>("default key"?? "default value");
}
vector<string> err_msg1 = error_msg(1);
vector<string> err_msg2 = error_msg(2);
vector<string> err_msg3 = error_msg(3);
cout<<"test return value list initialization: "<<err_msg1[1]<<' '<<err_msg2[1]<<' '<<err_msg3.empty()<<endl;
pair<string?? string> p1 = get_pair(1);
pair<string?? string> p2 = get_pair(2);
cout<<"test return pair list initialization: "<<p1.first<<' '<<p2.first<<endl;
???????????????
????C++11??????????????????????г????/?б???????
class InitClass
{
public:
void print_class()
{
cout<<field1<<' '<<field2<<' '<<field3<<' '<<field4<<endl;
}
private:
int field1 = 1;
int field2;
double field3 = 1.0;
double field4;
};
class InitClassMgr
{
public:
vector<InitClass> init_objs = {InitClass()};
};
InitClass test_class;
cout<<"test class member initialization: ";
test_class.print_class();
InitClassMgr mgr;
cout<<"test class member of class type initialization: ";
mgr.init_objs[0].print_class();
???????
????1??long long?????
????2??nullptr?????????????????
????3??constexpr????????????????
????4??noexcept????????????????????????????????????????????ж??????????????????????
????5????????????????????????new???????????б???????????????????????????????б???????
????6???????????????????г????/?б???????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????