|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
The stored form of an only mark: the complete set of languages a member may bind for — implicitly, not for any other. More...
#include <welder/annotations.hpp>
Public Member Functions | |
| template<class... Ls> | |
| consteval only_spec | operator() (lang first, Ls... rest) const |
| Name the complete set of languages the member may bind for. | |
Public Attributes | |
| unsigned | mask = 0 |
| The only languages to bind for; 0 == the (diagnosed) bare form. | |
The stored form of an only mark: the complete set of languages a member may bind for — implicitly, not for any other.
The closed-world counterpart of exclude_spec: exclude names languages to hide from (open-ended — a language it doesn't name still binds, including a welder::user_lang minted later), while only names everything that may bind. Under policy::opt_in it also counts as the member's opt-in, so no separate include is needed; an explicit exclude covering a language still beats an only naming it. Repeated only marks union their languages.
Unlike the other marks there is no meaningful bare form — "only, for every language" restricts nothing — so it must be called:
A bare [[=welder::mark::only]] is diagnosed when the member is resolved.
Definition at line 202 of file annotations.hpp.
|
inlineconsteval |
Name the complete set of languages the member may bind for.
| Ls | further language enum types (deduced). |
| first | the first language — at least one is required. |
| rest | further languages. |
Definition at line 211 of file annotations.hpp.
References welder::lang_mask().
| unsigned welder::detail::only_spec::mask = 0 |
The only languages to bind for; 0 == the (diagnosed) bare form.
Definition at line 203 of file annotations.hpp.