7 Expressions [expr]

7.5 Primary expressions [expr.prim]

7.5.8 Requires expressions [expr.prim.req]

7.5.8.3 Type requirements [expr.prim.req.type]

A type-requirement asserts the validity of a type.
The component names of a type-requirement are those of its nested-name-specifier (if any) and type-name (if any).
[Note 1: 
The enclosing requires-expression will evaluate to false if substitution of template arguments fails.
— end note]
[Example 1: template<typename T, typename T::type = 0> struct S; template<typename T> using Ref = T&; template<typename T> concept C = requires { typename T::inner; / required nested member name typename S<T>; / required valid ([temp.names]) template-id; fails if T​::​type does not exist as a type / to which 0 can be implicitly converted typename Ref<T>; / required alias template substitution, fails if T is void typename [:T::r1:]; / fails if T​::​r1 is not a reflection of a type typename [:T::r2:]<int>; / fails if T​::​r2 is not a reflection of a template Z for which Z<int> is a type }; — end example]
A type-requirement that names a class template specialization does not require that type to be complete ([basic.types.general]).

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant