为什么概念c ++中没有前向声明?

Why is there no forward declaration in concepts c++?

当我尝试这个例子时:

template <typename T>
concept only_int = std::same_as<T, int>;

int add_ints(only_int auto&&... args) {
    return (std::forward<decltype(args)>(args) + ... + 0);
}

它有效...但是当我只这样声明它时:

template <typename T>
concept only_int;

...

// defined later on...

它会抛出编译错误。

这是缺少的功能吗?还是打算就这样离开?

如果你可以前向声明概念,那么你就可以递归地使用它们。通过防止前向声明,概念声明中不必有明确的规定来阻止您递归地使用它们。