C++???????????????β?????ε????
???????????? ???????[ 2014/3/3 10:34:37 ] ????????C++ ??????? ????
??????????ε?????庯??????????????????????????е??????????????????庯???????μ?????????????Ρ?
???????磺template <typename T> int compare(const T& v1??const T& v2)
short s1??s2;
int i1??i2;
compare(i1??i2); //???????compare(int ??int)
compare(s1??s2); //???????compare(short??short)
???????????????compare(int ??int)??????short???????????ú???compare????????short?????????int?????????compare(int ??int)???????????????????μ????compare(short??short)??
?????????????????????β?????ε???????????????????????????
????1??const?????????const?????const???????????÷?const????????????????????????????μ??????????????????????????????β????????ζ?????const?????????????const???const?????????????????????????????????????????
????2???????????????????????????ββ????????????????????????????????ó?????????????????ν???????????????????????????ε????????????????
???????磺
template <typename T> T fobj(T??T);
template <typename T> T fref(const T&??const T&);
string s1("a value");
const string s2("another value");
fobj(s1??s2); //???????fobj(string??string)???????庯??????????????????α???????????????ε?const
fref(s1??s2); //???????fref(const string&??const string&)???βν???const???????????const??ο?????const????
int a[10]??b[42];
fobj(a??b); //???????fobj(int *??int *)?????鯔???????????????鶼???????????
fref(a??b); //????????β??????????鯔????????????a??b?????????????ó????????β??????????????????????????????????????????????????????????????С????βκ???????????????????????????δ?С???βδ?С??????
??????
???·???
??????????????????
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