#include #include #include // Based on a blog post: // https://andreasfertig.blog/2020/08/cpp20-concepts-testing-constrained-functions/ namespace clanguml { namespace t00058 { template struct first_type { using type = T; }; template using first_type_t = typename first_type::type; // TODO: Dependency of this concept on first_type<> template does not currently // work due to the fact that I don't know how to extract that information // from clang::DependentNameType to which first_type_t<> resolves to... template concept same_as_first_type = std::is_same_v, std::remove_cvref_t>>; template requires same_as_first_type struct A { std::vector a; }; template requires same_as_first_type struct B { std::vector b; P bb; }; struct R { A aa; B> bb; }; } }