Maybe there is a very simple reason but I so far couldn't figure out. Why does the standard not allow it? Concepts can't be used for scope resolution, and one can't use concepts as function parameters without auto
. So I don't see at what places would it be impossible for the compiler to tell clearly whether the programmer wanted to use the concept or the type, even though they have the same name.
SomeConcept::Whatever // not possible
void someFunc( SomeConcept auto& x ) // auto required
template<SomeConcept T> // concept instead of "typename"
"Easier to parse" I don't think is enough reason.
There is at least one case where the compiler would not be able to distinguish the meaning: in a template parameter, the identifier SomeConcept
could be a concept, or a non-type template parameter of class type.
e.g., the following is valid:
struct SomeConcept {};
template<SomeConcept T> void f() {}
// ... later used like
f<SomeConcept{}>();