摘要:
这段代码是这样的:template<typename T>int compare(const T& t1,const T& t2){ cout<<"范型"<<endl; return 1;}int main(){ cout<<compare("hello","world")<<endl;}template<>int compare<const char*>(const char* const &t1,const char* co 阅读全文
摘要:
That's all there is to it, but before you think that you've got allthis nailed down, answer this: What should be the type T in thefollowing declaration?constant_type<T>::type hello(constant("Hello"));Is it a char*? A const char*? No, it's actually a constant referenceto a 阅读全文