When I try this example:
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);
}
It works... but when I only declare it like this:
template <typename T>
concept only_int;
...
// defined later on...
It would throw compilation errors.
Is this a missing feature? or it is intended to leave like this?
If you could forward-declare concepts, then you could use them recursively. By preventing forward-declaration, there doesn't have to be an explicit provision in a concept declaration to stop you from using them recursively.