Jun's Blog

Recent content on Jun's Blog

马上订阅 Jun's Blog RSS 更新: https://www.junz.org/index.xml

C++模板基础

2022年2月27日 20:39
函数模板 先看几个简单的例子了解下函数模板是如何使用的: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 template<typename T> T max(T a, T b) { return b < a ? a : b; } max(1,2); // 隐式指定了模板实参