welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::detail::weld_protected_spec Struct Reference

The stored form of a policy::weld_protected annotation: the languages a type's protected members are admitted for. More...

#include <welder/annotations.hpp>

Public Member Functions

template<class... Ls>
consteval weld_protected_spec operator() (Ls... ls) const
 Scope the admission to specific languages.

Public Attributes

unsigned mask = 0
 The languages to admit protected members for; 0 == all.

Detailed Description

The stored form of a policy::weld_protected annotation: the languages a type's protected members are admitted for.

A distinct spec type — not a policy_kind — so it combines freely with policy::automatic / policy::opt_in: it widens which access levels are visible to the resolution, while the policy kind decides how greedily the visible members bind. Usable bare (all languages) or called with languages to scope it, like exclude_spec:

[[=welder::policy::weld_protected]] // all languages
constexpr detail::weld_protected_spec weld_protected
Admit the type's protected members into resolution — bare (all languages) or called with languages to...
@ py
Python (via the pybind11 and nanobind backends).
Definition lang.hpp:43

Repeated annotations union their languages. Private members are never admitted — that boundary is welder's design, not a policy.

Definition at line 130 of file annotations.hpp.

Member Function Documentation

◆ operator()()

template<class... Ls>
weld_protected_spec welder::detail::weld_protected_spec::operator() ( Ls... ls) const
inlineconsteval

Scope the admission to specific languages.

Template Parameters
Lsthe language enum types (deduced).
Parameters
lsthe languages to admit protected members for.
Returns
a scoped weld_protected_spec.

Definition at line 138 of file annotations.hpp.

References welder::lang_mask().

Member Data Documentation

◆ mask

unsigned welder::detail::weld_protected_spec::mask = 0

The languages to admit protected members for; 0 == all.

Definition at line 131 of file annotations.hpp.


The documentation for this struct was generated from the following file: