鉴于琐碎的概念定义:
template <class T> concept bool C = true;
Run Code Online (Sandbox Code Playgroud)
我们可以声明相同的函数模板f:
template <class T> requires C<T> void f(T);
template <class T> void f(T) requires C<T>;
template <C T> void f(T); // colloquially known as "terse" syntax
C{T} void f(T); // template introduction syntax
void f(C); // abbreviated function template syntax
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
103 次 |
| 最近记录: |