写明配置:
CPU: Intel Core i5-7500 @ 4x 3.8GHz(支持 SSE2、MMX、FPU、VME)
GPU: NVIDIA GeForce GTX 750 Ti(支持 CUDA)
RAM: 2048M DDR4
duangsuse::Echo
typed_printf.cpp
/*
* title: type safe printf
* author: nicekingwei
* related knowledge:
* - value and type
* value->value: function
* type->value: parametric polymorphism
* type->type: generic
* value->type: dependent type
* - auto
* - if constexpr
*/
Value and type:
value -> value: function
type -> value: parametric polymorphism
type -> type: generic
value -> type: dependent type
value -> value: function
type -> value: parametric polymorphism
type -> type: generic
value -> type: dependent type
duangsuse::Echo
Value and type: value -> value: function type -> value: parametric polymorphism type -> type: generic value -> type: dependent type
https://zh.wikipedia.org/wiki/%E5%8F%82%E6%95%B0%E5%A4%9A%E6%80%81
另外几个你们知道
另外几个你们知道
参数多态在程序设计语言与类型论中是指声明与定义函数、复合类型、变量时不指定其具体的类型,而把这部分类型作为参数使用,使得该定义对各种具体类型都适用。参数化多态使得语言更具表达力,同时保持了完全的静态类型安全。[1] 这被称为泛型函数、泛型数据类型、泛型变量,形成了泛型编程的基础。
参数多态名字来源于其发明人克里斯托弗·斯特雷奇,[2]与特设多态(ad hoc polymorphism)相对。特设多态是指一个多态函数有多个不同的实现,依赖于其实参而调用相应版本的函数。因此,特设多态仅支持有限数量的不同类型。
Wikipedia
参数多态
编程概念