nkr
A C++20 library with a custom meta-programming language.
nkr::tr Concept Reference

Used to filter a type by its qualifications, and by other types, templates, identities, and generics in the context of a declaration. More...

Concept definition

template<typename subject_p, typename ... expression_parts_p>
concept nkr::tr =
TR<t<subject_p>, expression_parts_p...>()
Used to filter a type by its qualifications, and by other types, templates, identities,...
Definition: tr_dec.h:262

Detailed Description

Used to filter a type by its qualifications, and by other types, templates, identities, and generics in the context of a declaration.

Distinct from the nkr::TR function, nkr::tr is a concept that can be used in the context of type and function declarations where only one subject is implicitly allowed for constraint. In the library proper, it is far more common to see this concept in use as compared to the underlying function, which is more prevalent in static_asserts such as are found in the numerous test suites for nkr.

Note
For more details about what nkr::tr and its underlying function are capable of, please see nkr::TR.
Note
Syntactically, nkr::tr is one of a handful of unique traits in the library that doesn't have the tr postfix. Instead it is simply named as such to strongly indicate that all other traits can be combined by use of this one.
Note
The most frequent use of this concept is found in method declarations which need to handle both volatile and non-volatile qualifications of variable types. What would otherwise have to be two or more functions can now be defined as one with these dynamically generated concepts produced by nkr::tr and the underlying nkr::TR function.