Conversation
| template <typename Traits> | ||
| using AccessTraitsMemorySpaceArchetypeAlias = typename Traits::memory_space; | ||
| template <class T, class U> | ||
| concept not_same_as = !std::same_as<T, U>; |
There was a problem hiding this comment.
I added this because there does not seem to be a non-void concept in std, and !std::same_as<void> did not work.
|
@dalg24 Could you please take a look at this PR? |
f07823d to
31bcb16
Compare
31bcb16 to
e8e40e2
Compare
|
Moved 'Concepts' namespace inside |
|
Here are what the errors look like for the In LLVM: So I see two suboptimal messages:
|
|
It seems that the details of notes seem to depend on whether but Which is fine, but is still interesting. |
Introduce complete_type<> concept.
|
@dalg24 I added couple commits:
I do agree with you that if the concepts allowed to specify our error messages, that would be ideal. The only step in that direction I've seen is the [EWG] P1267, but it went nowhere, it seems. The only alternative I see is to name each step of our concepts with some meaningful name, which is a pain. |
The patch introduces three concepts:
AccessTraits,Primitives(same asAccessTraits) andPredicates(AccessTraits+ tag). I put them intoConceptsnamespace.In general, it works fine. One corner point is how it interacts with CTAD.
clangevaluates the right hand side of CTAD before testing the concept, which leads to suboptimal errors instead of ignoring the CTAD (see godbolt). GCC, on the other hand, has a better treatment and properly rejects CTAD due to the unsatisfied requirement.