【240818】C++ 泛型编程里,为什么引入了 concept 这个概念?

14 阅读1分钟

参考资料

  1. 《Programming -- Principles and Practice Using C++ (3rd Edition)》—— Bjarne Stroustrup

Concept

Templates with unconstrained parameters, template, hav e many useful properties, such as great flexibility and near-optimal performance. But they doesn’t precisely state what is expected of an argument type T.

We call a set of requirements on a set of template arguments a concept.