????C++11????????????????????????
???????????? ???????[ 2016/1/27 10:34:03 ] ????????.NET ???????????
????auto
???????C?????????K&R????????auto a = 1;??д??????????????????????????????c++11??????C?????auto a = 1;???? auto int a = 1;??? ??C++11??auto?????????????????????????????????д
????int a = 1;
????????????????a??int???????????????д
????auto a = 1;
?????????????????????vector<string>::iterator????????????Щ??????
???????????????á???????????????????洦??????????????????????????????????????????????????????????????????????????auto?????????????????????????????
????template <typename BuiltType?? typename Builder>
????void makeAndProcessObject (const Builder& builder)
????{
????BuiltType val = builder.makeObject();
????// do stuff with val
????}
?????????????????BuiltType??????????????????д?????????
????????auto??????????д
????template <typename Builder>
????void makeAndProcessObject(const Builder& builder)
????{
????auto val = builder.makeObject();
????// do stuff with val
????}
?????????δ???????Щ?????????????????val??????????????????BuildTye??????c++11?????????????????????????????????????????????????????????????c++11??????????c++14??????????????2014/5/14??
??????????auto a = 1;???????????????????????????????????????????????????????????????????????????????
??????????????????????????auto???????????Щ????????????????????????????decltype???
????decltype
????decltype???declared Type?????????????
????decltype(x)?????x?????????????????????д??
????decltype(x) y = x;
?????????x?????????????????decltype(builder.makeObject())?????makeObject()??????????
??????????????auto??decltype???д?????????′???
????template <typename Builder>
????auto makeAndProcessObject(const Builder& builder) -> decltype(builder.makeObject())
????{
????auto val = builder.makeObject();
????// do stuff with val
????return val;
????}
?????????????????á?????????????????????decltype????????д????????????
???????費(fèi)?????д??????????????????
????decltype????????BS??2002??????????????????????gcc c++????????2008??????????visual c++ 2010????????????????????c++11??????????????????????????????????2013???ɡ?
????????????????????????????????????????????????????е??????
??????????????????????????????????????????????????????????????????
????????BS?????????????
??????
???·???
??????????????????
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