Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the conceptual method of using TS in C++?

Shulou Source: shulou.com Published: 2022-06-01 20:48:56 09月21日 Update

This article mainly explains "what is the conceptual method of using TS in C++". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the conceptual method of using TS in C++".

T.23: distinguish more refined concepts from more common scenarios by adding new usage patterns

Reason (reason)

Otherwise they cannot be distinguished automatically by the compiler.

Otherwise, they cannot be automatically distinguished by the compiler.

Example (using TS concepts) (example (using TS concept))

Template

Concept bool Input_iter = requires (I iter) {+ + iter;}

Template

Concept bool Fwd_iter = Input_iter & & requires (I iter) {iter++;}

The compiler can determine refinement based on the sets of required operations (here, suffix + +). This decreases the burden on implementers of these types since they do not need any special declarations to "hook into the concept". If two concepts have exactly the same requirements, they are logically equivalent (there is no refinement).

The compiler can decide to extract based on a set of necessary operations (in this case, the + suffix). Because this approach does not require a special definition deep within the concept, it reduces the burden of implementing these types. If two concepts have exactly the same requirements, they are logically equivalent (there is no refinement here)

Enforcement (implementation recommendations)

Flag a concept that has exactly the same requirements as another already-seen concept (neither is more refined). To disambiguate them, see T.24.

Tags and other concepts that have been seen (neither of which have been refined) have exactly the same concept of requirements.

Thank you for your reading, the above is the content of "what is the conceptual method of using TS in C++". After the study of this article, I believe you have a deeper understanding of what is the conceptual method of using TS in C++, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Concept method Clearing Learning same content that is Compiler requirement compilation necessary two Center cause suffix scenario suggestion idea situation article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Apple macOS Docker OPPO Reno