摘要: Alias(化名) Tempalte (template typedef) template <typename T> using Vec = std::vector<T, MyAlloc<T>>; the term vec<int> coll; is equivalent to std::vect 阅读全文
posted @ 2020-11-20 15:46 Codroc 阅读(154) 评论(0) 推荐(0) 编辑
摘要: decltype (declare type) decltype 相当于 typeof。 可以用来申明一个返回类型 template<typename T1, typename T2> decltype(x+y) add(T1 x, T2 y); 使用 decltype 可以使得编译器找到表达式的类 阅读全文
posted @ 2020-11-20 15:28 Codroc 阅读(301) 评论(0) 推荐(0) 编辑