摘要: 所有讨论都是底层const指针或引用,顶层const不会传递进模板。 模板中有const,不管传进来是否是const,T都是非const类型。 template<typename T> void f(const T& a) { } int a; const int b = 10; f(a); //T 阅读全文
posted @ 2022-06-10 10:04 hellozhangjz 阅读(231) 评论(0) 推荐(0)