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

The stored forms of the annotation vocabulary. More...

Classes

struct  any_type
 A placeholder class type for shape-probing a member template inside a concept. More...
struct  doc_spec
 The stored form of a doc annotation: a summary docstring. More...
struct  exclude_spec
 The stored form of an exclude mark: the languages a member is hidden from. More...
struct  field_access
 Splice-based accessors for data member Mem — the pointer-to-member-free route the rods bind a protected field through. More...
struct  fixed_string
 A string literal captured by value, length included, so it can live in a structural annotation constant. More...
struct  function_doc
 The raw documentation pieces of a function, handed to a style to assemble. More...
struct  include_spec
 The stored form of an include mark: the languages a member is opted into. More...
struct  keep_alive_pair
 A keep_alive lifetime dependency: a (nurse, patient) index pair. More...
struct  keep_alive_spec
 The stored form of a keep_alive annotation: a lifetime dependency between two of a call's entities, addressed by pybind11/nanobind's index convention (0 = the return value, 1 = the first argument — the implicit this for a method — 2 = the second, …). More...
struct  module_welder
 Pick the entry macro's welder: the user's optional override, else the rod's default welder::welder<rod>. More...
struct  module_welder< Default, First, Rest... >
struct  only_spec
 The stored form of an only mark: the complete set of languages a member may bind for — implicitly, not for any other. More...
struct  param_doc
 One function parameter's documentation: its identifier (nullptr if unnamed) and its doc text (nullptr if undocumented). More...
struct  policy_spec
 The stored form of a policy annotation. More...
struct  return_doc_spec
 The stored form of a returns annotation: a function's return-value doc. More...
struct  return_policy_spec
 The stored form of a return_policy annotation: a return-value policy, optionally scoped to some languages. More...
struct  scoped_registration
 The scope-aware registration oracle: Resolution widened with the member-alias registrations of one class. More...
struct  tparam_doc
 One documented template parameter of an entity: the parameter's name (as spelled in the tparam annotation) and its doc text. More...
struct  tparam_spec
 The stored form of a tparam annotation: one template parameter's doc. More...
struct  trust_bindable_spec
 The stored form of a trust_bindable member mark. More...
struct  weld_as_spec
 The stored form of a weld_as annotation: a forced target-language name. More...
struct  weld_protected_spec
 The stored form of a policy::weld_protected annotation: the languages a type's protected members are admitted for. More...
struct  weld_spec
 The stored form of a weld annotation: the mask of target languages. More...
struct  wrapper_spec
 One row of the element-wise STL-wrapper table. More...

Typedefs

using overload_selector
 The signature of an overload-set selector specialization: the representative overload, the language, and the entity the group binds into.
template<class Default, class... Override>
using module_welder_t = typename module_welder<Default, Override...>::type

Enumerations

enum class  any_enum
 A placeholder enum type for shape-probing the enum hooks against a rod's enum_handle_type<E>any_type is a class, so it cannot stand in for an enum. More...

Functions

consteval unsigned weld_as_mask ()
 The language mask of a weld_as argument list: the OR of its leading lang markers (the trailing name contributes nothing; no markers → 0 = all).
template<size_type N>
consteval unsigned weld_as_mask (const char(&)[N])
template<class... Rest>
consteval unsigned weld_as_mask (lang l, Rest &&... rest)
template<size_type N>
consteval fixed_string< N > weld_as_name (const char(&s)[N])
 The verbatim name of a weld_as argument list: the trailing string, reached by dropping the leading lang markers (its extent N preserved by reference).
template<class... Rest>
consteval auto weld_as_name (lang, Rest &&... rest)
consteval unsigned return_policy_mask (rv_kind)
 The language mask of a return_policy argument list: the OR of its leading lang markers (the trailing kind contributes nothing; no markers → 0 = all).
template<class... Rest>
consteval unsigned return_policy_mask (lang l, Rest... rest)
consteval rv_kind return_policy_kind (rv_kind k)
 The policy of a return_policy argument list: the trailing kind, reached by dropping the leading lang markers.
template<class... Rest>
consteval rv_kind return_policy_kind (lang, Rest... rest)
template<std::meta::info Fn>
consteval auto param_types ()
 A function's parameter types, as a static array of reflections.
template<std::meta::info Fn>
consteval auto param_names ()
 A function's parameter names, in order.
template<std::meta::info Fn>
consteval auto keep_alive_pairs ()
 The keep_alive dependencies declared on Fn, in declaration order.
template<std::meta::info Fn>
consteval bool all_params_named ()
 Whether every parameter of Fn carries an identifier.
consteval bool is_bindable_constructor (std::meta::info c)
 A non-default, non-copy/move public constructor a backend should expose.
consteval bool is_method_candidate (std::meta::info f)
 The shape of a bindable method: a plain non-private member function.
consteval bool is_operator_candidate (std::meta::info f)
 The shape of a bindable member operator.
template<class Resolution>
consteval bool member_access_admitted (std::meta::info mem, lang L, std::meta::info bound_into)
 Is mem's access level admitted for binding under Resolution?
consteval bool is_unary_operator (std::meta::info f)
 Whether a member operator is unary (0 parameters) vs binary (1 parameter).
template<class T>
consteval auto aggregate_fields ()
 The fields an aggregate is initialized from: its non-static data members in declaration order (all public, by the aggregate rules).
template<class T, lang L, class Resolution>
consteval bool aggregate_initializable ()
 Whether to synthesize an aggregate field constructor for T (language L, resolution Resolution).
consteval bool is_bindable_kind (std::meta::info mem)
 The member kinds welder can expose from a namespace.
consteval bool entity_bound (std::meta::info mem, lang L, policy_kind pol)
 Whether a leaf entity binds: a welded candidate that also resolves as bound.
consteval bool namespace_has_bound (std::meta::info ns, lang L)
 Whether ns holds anything that would bind, directly or nested.
consteval bool namespace_has_bindable (std::meta::info ns, lang L)
 The greedy twin of namespace_has_bound: whether ns holds any bindable kind (ignoring the weld marker), directly or nested.
template<class Resolution>
consteval std::vector< std::meta::info > method_overload_set (std::meta::info fn, lang L, std::meta::info bound_into)
 The participating method overloads sharing fn's name and static-ness, from the class where fn is declared, in declaration order.
template<class Resolution>
consteval std::vector< std::meta::info > operator_overload_set (std::meta::info fn, lang L, std::meta::info bound_into)
 The participating operator overloads sharing fn's target slot (same operator and arity — hence the same special-method name), from fn's declaring class.
template<class Resolution>
consteval std::vector< std::meta::info > function_overload_set (std::meta::info fn, lang L, std::meta::info bound_into)
 The participating free-function overloads sharing fn's name, from fn's declaring namespace, in declaration order.
template<overload_selector Select, std::meta::info Fn, lang L, std::meta::info BoundInto>
consteval auto overload_group ()
 Select's overload set for Fn as a fixed-size, splice-ready static array.
template<overload_selector Select>
consteval bool is_overload_leader (std::meta::info fn, lang L, std::meta::info bound_into)
 Whether fn is the first (declaration order) member of its Select overload set — the single visit on which the carriage emits the whole group.
template<class Resolution, std::meta::info Fn, lang L>
consteval auto manual_function_group ()
 The semi-manual (weld_function<Fn>) group: Fn first — the user's named entity resolves the group's target name — then Fn's participating siblings.
template<class Resolution, std::meta::info Type, lang L, policy_kind Pol>
consteval auto ctor_group ()
 The participating constructors of Type under policy Pol: every bindable-shape constructor (see is_bindable_constructor) the resolution admits, in declaration order.
template<class Resolution, std::meta::info Type, lang L>
consteval bool default_ctor_admitted ()
 Whether the resolution admits Type's DEFAULT constructor.
consteval void collect_native_bases (std::meta::info type, lang L, std::vector< std::meta::info > &out)
 Collect the native bases of type for L: its nearest welded ancestors.
template<std::meta::info Type, lang L>
consteval auto native_base_types ()
 The native bases of Type for L as a static array of type reflections.
template<caster_oracle B, class T, lang L, class Reg>
consteval bool bindable ()
 Forward declaration: bindable() recurses through a container's element types.
consteval std::array< wrapper_spec, 18 > stl_wrappers ()
 The element-wise STL-wrapper table welder recurses into.
consteval long wrapper_value_count (std::meta::info type)
 How many leading arguments of type to recurse if it is a listed wrapper.
template<std::meta::info Type, std::size_t N>
consteval std::array< std::meta::info, N > leading_args ()
 The first N template arguments of Type, as a splice-ready static array.
template<caster_oracle B, lang L, class Reg, auto Args, std::size_t... I>
consteval bool args_bindable (std::index_sequence< I... >)
 Whether every one of a wrapper's value arguments (spliced back to types) binds.
template<caster_oracle B, std::meta::info Fn, lang L, class Reg, std::size_t... I>
consteval void assert_params_bindable (std::index_sequence< I... >)
 Assert every parameter type of Fn binds.
template<class Resolution, std::meta::info Ns, std::meta::info Alias>
consteval bool sole_alias_of_target (lang L, policy_kind pol)
 Is Alias the only participating alias in Ns welding its specialization?
template<std::meta::info Alias, lang L, class Style, ent_kind Kind = ent_kind::class_>
consteval const char * alias_bound_name ()
 The bound name of the type welded through Alias (a namespace-scope alias to a specialization, or a member alias inside a welded class).
template<class Resolution>
consteval bool nested_type_registered (std::meta::info type, lang L)
 The GATE side of the nested-type sweep: does class-scoped type register with its enclosing class's binding under Resolution?
template<class Resolution, std::meta::info Outer, std::meta::info Alias>
consteval bool sole_member_alias_of_target (lang L, policy_kind pol)
 Is Alias the only member alias of Outer whose participation would register its target?
template<class Resolution>
consteval bool registered_by_member_alias (std::meta::info scope, std::meta::info type, lang L)
 Does a participating member alias of scope name type — i.e.

Detailed Description

The stored forms of the annotation vocabulary.

The raw documentation pieces doc_style assembles; its full definition (a data struct) lives in <welder/doc.hpp>.

Each *_spec here is what a factory below (weld, doc, …) or a policy / mark object produces and what the reflection layer extracts back off an entity's annotations. Users never name these types — they spell the factories — so they live in detail to keep welder:: uncluttered.

Forward-declared here so this concepts header stays a dependency-light leaf the machinery headers can include.

Typedef Documentation

◆ module_welder_t

template<class Default, class... Override>
using welder::detail::module_welder_t = typename module_welder<Default, Override...>::type

Definition at line 26 of file module.hpp.

◆ overload_selector

Initial value:
std::vector<std::meta::info> (*)(std::meta::info, lang, std::meta::info)
lang
The target languages welder ships rods for — but not the whole value space.
Definition lang.hpp:42

The signature of an overload-set selector specialization: the representative overload, the language, and the entity the group binds into.

Definition at line 490 of file bind_traits.hpp.

Enumeration Type Documentation

◆ any_enum

enum class welder::detail::any_enum
strong

A placeholder enum type for shape-probing the enum hooks against a rod's enum_handle_type<E>any_type is a class, so it cannot stand in for an enum.

Empty on purpose; the concept never inspects its enumerators.

Definition at line 56 of file concepts.hpp.

Function Documentation

◆ aggregate_fields()

template<class T>
auto welder::detail::aggregate_fields ( )
consteval

◆ aggregate_initializable()

template<class T, lang L, class Resolution>
bool welder::detail::aggregate_initializable ( )
consteval

Whether to synthesize an aggregate field constructor for T (language L, resolution Resolution).

Only for a baseless aggregate with at least one field, all of which participate: a based aggregate's brace-init nests the base (a flat field ctor can't express it), and a partially-excluded one would leak an excluded field as a positional parameter (aggregate init is positional and all-or-nothing). An empty aggregate is already covered by the default constructor.

Template Parameters
Tthe aggregate type.
Lthe target language.
Resolutionthe carriage's resolution (its class_member_participates decides whether each field binds).
Returns
true iff a field constructor should be synthesized.

Definition at line 312 of file bind_traits.hpp.

References welder::policy_of(), and welder::public_bases().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_class_interior().

◆ alias_bound_name()

template<std::meta::info Alias, lang L, class Style, ent_kind Kind = ent_kind::class_>
const char * welder::detail::alias_bound_name ( )
consteval

The bound name of the type welded through Alias (a namespace-scope alias to a specialization, or a member alias inside a welded class).

Resolution order: a weld_as on the alias (most specific, verbatim) → a weld_as on the target type (read through an instantiation from its template; note a template-level one names every instantiation alike, so pairing it with several aliases of one template collides) → the alias's identifier, reshaped by Style. This is welder::name_of applied to the alias, with the target-level weld_as fallback spliced in between its two steps.

Template Parameters
Aliasthe alias through which the type is welded.
Lthe target language.
Stylethe name style.
Kindthe entity kind the style hook receives (class_ or enum_).
Returns
the bound name, in static storage.

Definition at line 89 of file carriage.hpp.

References welder::name_of(), and welder::weld_as_of().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_types().

◆ all_params_named()

template<std::meta::info Fn>
bool welder::detail::all_params_named ( )
consteval

Whether every parameter of Fn carries an identifier.

Keyword-argument naming is all-or-nothing across backends, so an unnamed parameter means positional.

Template Parameters
Fna reflection of the function.
Returns
true iff all parameters are named.

Definition at line 101 of file bind_traits.hpp.

Referenced by welder::rods::nanobind::rod< DocStyle >::_def_function(), welder::rods::pybind11::rod< DocStyle >::_def_function(), welder::rods::nanobind::rod< DocStyle >::_def_init(), and welder::rods::pybind11::rod< DocStyle >::_def_init().

◆ args_bindable()

template<caster_oracle B, lang L, class Reg, auto Args, std::size_t... I>
bool welder::detail::args_bindable ( std::index_sequence< I... > )
consteval

Whether every one of a wrapper's value arguments (spliced back to types) binds.

Template Parameters
Bthe rod.
Lthe target language.
Regthe registration oracle (see welder::welded_registration).
Argsthe static array of value-argument reflections.
Ithe index pack over Args.

Definition at line 152 of file bindable.hpp.

References bindable().

Referenced by bindable().

◆ assert_params_bindable()

template<caster_oracle B, std::meta::info Fn, lang L, class Reg, std::size_t... I>
void welder::detail::assert_params_bindable ( std::index_sequence< I... > )
consteval

Assert every parameter type of Fn binds.

Template Parameters
Bthe rod.
Fna reflection of the function.
Lthe target language.
Ithe index pack over the parameters.

Definition at line 242 of file bindable.hpp.

References welder::assert_bindable(), and param_types().

Referenced by welder::assert_signature_bindable().

◆ bindable()

template<caster_oracle B, class T, lang L, class Reg>
bool welder::detail::bindable ( )
consteval

Forward declaration: bindable() recurses through a container's element types.

Can the backend convert T — stripped of cv/ref/pointer — to a meaningful target value?

A listed wrapper is bindable iff its value arguments are; a type with a native/user converter binds as-is; otherwise it is a program-defined class/enum the backend must register, so it binds iff the registration oracle Reg promises one (by default: iff it is welded for L).

Template Parameters
Bthe rod.
Tthe type to test.
Lthe target language.
Regthe registration oracle (see welder::welded_registration).

Definition at line 169 of file bindable.hpp.

References args_bindable(), leading_args(), welder::trust_bindable, and wrapper_value_count().

Referenced by args_bindable(), and welder::bindable().

◆ collect_native_bases()

void welder::detail::collect_native_bases ( std::meta::info type,
lang L,
std::vector< std::meta::info > & out )
consteval

Collect the native bases of type for L: its nearest welded ancestors.

Found by looking past non-welded bases (whose members are flattened instead), so a welded base reachable only through a non-welded one is still linked. A virtual diamond can reach the same welded base by several paths, so the list is deduplicated.

Parameters
typea reflection of the derived type.
Lthe target language.
[out]outaccumulates the deduplicated native base reflections.

Definition at line 656 of file bind_traits.hpp.

References collect_native_bases(), welder::public_bases(), and welder::welded_for().

Referenced by collect_native_bases(), and native_base_types().

◆ ctor_group()

template<class Resolution, std::meta::info Type, lang L, policy_kind Pol>
auto welder::detail::ctor_group ( )
consteval

The participating constructors of Type under policy Pol: every bindable-shape constructor (see is_bindable_constructor) the resolution admits, in declaration order.

Constructors resolve symmetrically with every other member — the type's policy and the constructor's own marks decide, per constructor (opt_in binds only marked-include constructors). The carriage guards the silent consequence: filtering that leaves a type with no constructor at all is a hard error unless the emptiness is explicit (see bind_type's no-constructor-left static_assert), which is why Pol is a parameter — the guard probes the same resolution under policy_kind::automatic as its baseline.

The default constructor is decided separately (it may be implicit, hence not a member — see default_ctor_admitted), as is the synthesized aggregate constructor.

Template Parameters
Resolutionthe carriage's resolution.
Typethe class type reflection.
Lthe target language.
Polthe policy to resolve under (the type's own, or automatic for the guard's baseline).
Returns
the constructor reflections as a static array.

Definition at line 589 of file bind_traits.hpp.

References is_bindable_constructor().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_class_interior().

◆ default_ctor_admitted()

template<class Resolution, std::meta::info Type, lang L>
bool welder::detail::default_ctor_admitted ( )
consteval

Whether the resolution admits Type's DEFAULT constructor.

The default constructor may be implicit — no declaration, so no marks and nothing for opt_in to filter: it is admitted whenever the type is default-constructible (the carriage checks constructibility itself, against the rod's construction type). A declared default constructor is consulted under policy_kind::automatic — its explicit marks are honored (so [[=welder::mark::exclude]] T() = default; suppresses default construction), but opt_in's default-out is not: you cannot include an implicit constructor, so filtering the declared spelling by default would make T() = default; (a C++ no-op) silently change the binding.

Template Parameters
Resolutionthe carriage's resolution.
Typethe class type reflection.
Lthe target language.

Definition at line 625 of file bind_traits.hpp.

References welder::automatic.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_class_interior().

◆ entity_bound()

bool welder::detail::entity_bound ( std::meta::info mem,
lang L,
policy_kind pol )
consteval

Whether a leaf entity binds: a welded candidate that also resolves as bound.

Parameters
mema reflection of the namespace member.
Lthe target language.
polthe namespace's policy.
Returns
true iff mem is a bindable kind, welded for L, and bound under pol and its own marks.

Definition at line 350 of file bind_traits.hpp.

References is_bindable_kind(), welder::member_bound(), and welder::welded_for().

Referenced by namespace_has_bound().

◆ function_overload_set()

template<class Resolution>
std::vector< std::meta::info > welder::detail::function_overload_set ( std::meta::info fn,
lang L,
std::meta::info bound_into )
consteval

The participating free-function overloads sharing fn's name, from fn's declaring namespace, in declaration order.

Membership is the resolution's namespace-member verdict, so the set is exactly what the namespace walk binds.

Template Parameters
Resolutionthe carriage's resolution.
Parameters
fna reflection of one participating namespace-scope function.
Lthe target language.
bound_intothe namespace being swept (== parent_of(fn); passed for hook-signature uniformity).
Returns
the overload set (always contains fn).

Definition at line 474 of file bind_traits.hpp.

References welder::policy_of().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), and manual_function_group().

◆ is_bindable_constructor()

bool welder::detail::is_bindable_constructor ( std::meta::info c)
consteval

A non-default, non-copy/move public constructor a backend should expose.

The default constructor is handled separately (it may be implicit, hence not a member).

Parameters
ca reflection of the constructor.
Returns
true iff c is public, non-deleted, not copy/move, and takes at least one parameter.

Definition at line 118 of file bind_traits.hpp.

Referenced by ctor_group().

◆ is_bindable_kind()

bool welder::detail::is_bindable_kind ( std::meta::info mem)
consteval

The member kinds welder can expose from a namespace.

is_class_type/is_enum_type throw on a non-type reflection, so they are reached only after is_type; the other predicates are total and safe on any reflection.

Parameters
mema reflection of the namespace member.
Returns
true iff mem is a class/enum type, a function, or a variable.

Definition at line 336 of file bind_traits.hpp.

Referenced by entity_bound(), and namespace_has_bindable().

◆ is_method_candidate()

bool welder::detail::is_method_candidate ( std::meta::info f)
consteval

The shape of a bindable method: a plain non-private member function.

Shape only — whether it participates is the resolution's decision (its class_member_participates hook; member_bound under the shipped resolutions), and whether its access level is admitted is member_access_admitted's (public always, protected under policy::weld_protected / the resolution's protected_participates hook); both are composed by the carriage. Private members are rejected here, in the shape — exposing a private member is a violation of welder's design, so no resolution can readmit one. Special members, destructors and operators are skipped (operators are classified separately).

Parameters
fa reflection of the member function.
Returns
true iff f is a non-private, non-deleted, non-special member function.

Definition at line 140 of file bind_traits.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), and method_overload_set().

◆ is_operator_candidate()

bool welder::detail::is_operator_candidate ( std::meta::info f)
consteval

The shape of a bindable member operator.

Shape only, like is_method_candidate — participation is the resolution's call, access admission member_access_admitted's, and private is rejected here for the same design reason. Whether it maps to something in the target language — and under what name — is a backend decision (see rod::special_method_name).

Parameters
fa reflection of the operator function.
Returns
true iff f is a non-private, non-deleted, non-special member operator.

Definition at line 158 of file bind_traits.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), and operator_overload_set().

◆ is_overload_leader()

template<overload_selector Select>
bool welder::detail::is_overload_leader ( std::meta::info fn,
lang L,
std::meta::info bound_into )
consteval

Whether fn is the first (declaration order) member of its Select overload set — the single visit on which the carriage emits the whole group.

Template Parameters
Selectthe selector specialization.
Parameters
fnthe candidate overload.
Lthe target language.
bound_intothe entity whose binding receives the group.

Definition at line 521 of file bind_traits.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace().

◆ is_unary_operator()

bool welder::detail::is_unary_operator ( std::meta::info f)
consteval

Whether a member operator is unary (0 parameters) vs binary (1 parameter).

Told apart by arity — this disambiguates the operators with both forms (+, -); backends use it to pick, e.g., __neg__ vs __sub__.

Parameters
fa reflection of the operator function.
Returns
true iff f is unary.

Definition at line 264 of file bind_traits.hpp.

Referenced by welder::rods::luacats::rod::add_operator(), welder::rods::lua::lua_metamethod_name(), welder::rods::python::operator_dunder(), welder::rods::luacats::operator_luacats(), welder::rods::sol2::operator_mm(), and operator_overload_set().

◆ keep_alive_pairs()

template<std::meta::info Fn>
auto welder::detail::keep_alive_pairs ( )
consteval

The keep_alive dependencies declared on Fn, in declaration order.

Materialized as a fixed-size static array so a rod can splice each pair back as a keep_alive<nurse, patient>() call-policy template argument. Empty when Fn carries no keep_alive annotation.

Template Parameters
Fna reflection of the callable.
Returns
an array of the (nurse, patient) pairs.

Definition at line 79 of file bind_traits.hpp.

Referenced by welder::rods::nanobind::rod< DocStyle >::_def_function(), welder::rods::nanobind::rod< DocStyle >::_def_function(), welder::rods::pybind11::rod< DocStyle >::_def_function(), and welder::rods::pybind11::rod< DocStyle >::_def_function().

◆ leading_args()

template<std::meta::info Type, std::size_t N>
std::array< std::meta::info, N > welder::detail::leading_args ( )
consteval

The first N template arguments of Type, as a splice-ready static array.

Template Parameters
Typethe specialization to read.
Nhow many leading arguments to take.

Definition at line 133 of file bindable.hpp.

Referenced by bindable().

◆ manual_function_group()

template<class Resolution, std::meta::info Fn, lang L>
auto welder::detail::manual_function_group ( )
consteval

The semi-manual (weld_function<Fn>) group: Fn first — the user's named entity resolves the group's target name — then Fn's participating siblings.

Gathering the siblings keeps weld_function consistent with the namespace walk (and keeps one-value-per-name frameworks from silently clobbering): one call welds the name's participating overload set. Fn itself is included even when its own marks would resolve it out — the explicit call is the stronger statement of intent. An identifier-less Fn (a template instantiation formed with substitute) has no name for siblings to share, so its group is just itself.

Template Parameters
Resolutionthe carriage's resolution.
Fnthe explicitly welded function.
Lthe target language.
Returns
the group as a static array, Fn first.

Definition at line 542 of file bind_traits.hpp.

References function_overload_set().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_function().

◆ member_access_admitted()

template<class Resolution>
bool welder::detail::member_access_admitted ( std::meta::info mem,
lang L,
std::meta::info bound_into )
consteval

Is mem's access level admitted for binding under Resolution?

The access counterpart of class_member_participates: public members are always admitted; private members never are (hard-wired here, before the resolution is consulted — exposing a private member is a violation of welder's design, not a policy a resolution may choose); protected members are arbitrated by the resolution's optional protected_participates(mem, L, bound_into) hook, falling back — when the resolution declares none — to the declaring class's policy::weld_protected annotation (welder::protected_welded). The fallback keeps the annotation honored under any bespoke resolution unless it deliberately takes the decision over; the tack-welding greedy_resolution exposes it as a template knob for libraries that cannot be annotated.

bound_into is the entity whose binding receives the member — the welded (most-derived) type, held fixed through the base-flattening recursion, or the enum for an enumerator. It equals parent_of(mem) except when a non-welded base's member is flattened onto a derived binding — exactly the case a bespoke hook may want to key on ("admit this mixin's protected members, but only into `Derived`"). The shipped resolutions ignore it (the declaring-class annotation rule).

A protected member admitted here still resolves through the normal machinery (policy kind, marks, overload grouping, the bindability gate) — admission only makes it visible. Emission needs no publicist and no generated wrapper: access control applies to names, and welder binds through spliced pointers-to-member (&[:mem:]), which P2996 exempts from access checking once the reflection was obtained (welder queries with access_context::unchecked() throughout).

Template Parameters
Resolutionthe carriage's resolution.
Parameters
mema reflection of the class member.
Lthe target language.
bound_intothe entity whose binding receives the member.
Returns
true iff mem's access level admits it for L.

Definition at line 202 of file bind_traits.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_types(), method_overload_set(), nested_type_registered(), operator_overload_set(), registered_by_member_alias(), and sole_member_alias_of_target().

◆ method_overload_set()

template<class Resolution>
std::vector< std::meta::info > welder::detail::method_overload_set ( std::meta::info fn,
lang L,
std::meta::info bound_into )
consteval

The participating method overloads sharing fn's name and static-ness, from the class where fn is declared, in declaration order.

Template Parameters
Resolutionthe carriage's resolution.
Parameters
fna reflection of one participating method (see is_method_candidate).
Lthe target language.
bound_intothe entity whose binding receives the group (the welded type — not necessarily parent_of(fn) when flattening a base).
Returns
the overload set (always contains fn).

Definition at line 423 of file bind_traits.hpp.

References is_method_candidate(), member_access_admitted(), and welder::policy_of().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members().

◆ namespace_has_bindable()

bool welder::detail::namespace_has_bindable ( std::meta::info ns,
lang L )
consteval

The greedy twin of namespace_has_bound: whether ns holds any bindable kind (ignoring the weld marker), directly or nested.

Used by the tack-welding resolution to decide whether an unmarked namespace is worth turning into a submodule. Same shape as namespace_has_bound but with the welded_for gate dropped — a member counts if it is a bindable kind resolving as bound under the (marker-less) policy.

Parameters
nsa reflection of the namespace.
Lthe target language.
Returns
true iff some member (possibly nested) is a bindable kind that binds.

Definition at line 389 of file bind_traits.hpp.

References is_bindable_kind(), welder::member_bound(), namespace_has_bindable(), and welder::policy_of().

Referenced by namespace_has_bindable(), and welder::carriages::greedy_resolution< WeldProtected >::namespace_participates().

◆ namespace_has_bound()

bool welder::detail::namespace_has_bound ( std::meta::info ns,
lang L )
consteval

Whether ns holds anything that would bind, directly or nested.

I.e. whether exposing it would yield a non-empty (sub)module. Each namespace contributes under its own policy; a nested namespace is recursed by the same rule as the dispatch (member_bound under the namespace's policy: automatic unless excluded, opt_in only if included).

Parameters
nsa reflection of the namespace.
Lthe target language.
Returns
true iff some member (possibly nested) binds.

Definition at line 364 of file bind_traits.hpp.

References entity_bound(), welder::member_bound(), namespace_has_bound(), and welder::policy_of().

Referenced by namespace_has_bound(), and welder::carriages::marker_resolution::namespace_participates().

◆ native_base_types()

template<std::meta::info Type, lang L>
auto welder::detail::native_base_types ( )
consteval

The native bases of Type for L as a static array of type reflections.

Usable as a non-type template argument (spliced into the backend's class handle template). Same set as collect_native_bases().

Template Parameters
Typethe derived type reflection.
Lthe target language.
Returns
an array of the native base type reflections.

Definition at line 683 of file bind_traits.hpp.

References collect_native_bases().

Referenced by welder::carriages::marker_resolution::native_bases().

◆ nested_type_registered()

template<class Resolution>
bool welder::detail::nested_type_registered ( std::meta::info type,
lang L )
consteval

The GATE side of the nested-type sweep: does class-scoped type register with its enclosing class's binding under Resolution?

Mirrors basic_carriage::bind_nested_types' selection exactly — a nested type resolves like any other class member (the outer's policy plus the type's own exclude/include/only marks, with the usual access admission), never via its own weld — so the bindability gate promises a registration precisely when the sweep provides one. The enclosing class must itself count as registered (recursively, for deeper nesting). Unnameable (unnamed) and incomplete member types never register, and a member type alias is not a declaration the sweep visits — callers see false through the identifier/completeness checks and the alias never reaching here dealiased to a namespace-scope parent.

Template Parameters
Resolutionthe resolution whose sweep is being promised for.
Parameters
typea class-scoped class/enum type (see welder::is_nested_type).
Lthe target language.
Returns
true iff welding the enclosing class registers type.

Definition at line 131 of file carriage.hpp.

References member_access_admitted(), welder::member_bound(), and welder::policy_of().

Referenced by welder::carriages::greedy_resolution< WeldProtected >::counts_as_registered(), welder::carriages::marker_resolution::counts_as_registered(), and welder::detail::scoped_registration< Resolution, Scope >::counts_as_registered().

◆ operator_overload_set()

template<class Resolution>
std::vector< std::meta::info > welder::detail::operator_overload_set ( std::meta::info fn,
lang L,
std::meta::info bound_into )
consteval

The participating operator overloads sharing fn's target slot (same operator and arity — hence the same special-method name), from fn's declaring class.

Template Parameters
Resolutionthe carriage's resolution.
Parameters
fna reflection of one participating operator (see is_operator_candidate).
Lthe target language.
bound_intothe entity whose binding receives the group.
Returns
the overload set (always contains fn).

Definition at line 449 of file bind_traits.hpp.

References is_operator_candidate(), is_unary_operator(), member_access_admitted(), and welder::policy_of().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members().

◆ overload_group()

template<overload_selector Select, std::meta::info Fn, lang L, std::meta::info BoundInto>
auto welder::detail::overload_group ( )
consteval

Select's overload set for Fn as a fixed-size, splice-ready static array.

Template Parameters
Selectthe selector specialization (e.g. method_overload_set<R>).
Fnthe representative overload.
Lthe target language.
BoundIntothe entity whose binding receives the group.
Returns
an array of the group's member reflections, in declaration order.

Definition at line 501 of file bind_traits.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace().

◆ param_names()

template<std::meta::info Fn>
auto welder::detail::param_names ( )
consteval

A function's parameter names, in order.

Template Parameters
Fna reflection of the function.
Returns
an array of static-storage C strings, one per parameter, or nullptr for an unnamed one.

Definition at line 54 of file bind_traits.hpp.

Referenced by welder::rods::nanobind::rod< DocStyle >::_def_function(), welder::rods::pybind11::rod< DocStyle >::_def_function(), welder::rods::nanobind::rod< DocStyle >::_def_init(), and welder::rods::pybind11::rod< DocStyle >::_def_init().

◆ param_types()

template<std::meta::info Fn>
auto welder::detail::param_types ( )
consteval

A function's parameter types, as a static array of reflections.

Usable as a non-type template argument so it can be spliced back into a pack.

Template Parameters
Fna reflection of the function.
Returns
an array of the parameter type reflections, in order.

Definition at line 38 of file bind_traits.hpp.

Referenced by welder::rods::nanobind::rod< DocStyle >::_def_init(), welder::rods::pybind11::rod< DocStyle >::_def_init(), assert_params_bindable(), and welder::rods::luacats::param_lua_types().

◆ registered_by_member_alias()

template<class Resolution>
bool welder::detail::registered_by_member_alias ( std::meta::info scope,
std::meta::info type,
lang L )
consteval

Does a participating member alias of scope name type — i.e.

would the sweep of scope register type under that alias?

The alias side of the scope-aware oracle (see scoped_registration). Deliberately no bindability re-check on the target: the oracle is consulted only where every other bindable() branch has already failed, which is exactly the sweep's register-vs-skip arbiter — so "an admitted, participating alias names it" is the whole remaining question.

Template Parameters
Resolutionthe carriage's resolution policy.
Parameters
scopethe class whose member aliases to scan.
typethe candidate target type.
Lthe target language.
Returns
true iff a participating member alias of scope names type.

Definition at line 186 of file carriage.hpp.

References member_access_admitted(), and welder::policy_of().

Referenced by welder::detail::scoped_registration< Resolution, Scope >::counts_as_registered().

◆ return_policy_kind() [1/2]

template<class... Rest>
rv_kind welder::detail::return_policy_kind ( lang ,
Rest... rest )
consteval

Definition at line 592 of file annotations.hpp.

References return_policy_kind().

◆ return_policy_kind() [2/2]

rv_kind welder::detail::return_policy_kind ( rv_kind k)
consteval

The policy of a return_policy argument list: the trailing kind, reached by dropping the leading lang markers.

Definition at line 590 of file annotations.hpp.

Referenced by welder::return_policy(), and return_policy_kind().

◆ return_policy_mask() [1/2]

template<class... Rest>
unsigned welder::detail::return_policy_mask ( lang l,
Rest... rest )
consteval

Definition at line 584 of file annotations.hpp.

References welder::lang_bit(), and return_policy_mask().

◆ return_policy_mask() [2/2]

unsigned welder::detail::return_policy_mask ( rv_kind )
consteval

The language mask of a return_policy argument list: the OR of its leading lang markers (the trailing kind contributes nothing; no markers → 0 = all).

Definition at line 582 of file annotations.hpp.

Referenced by welder::return_policy(), and return_policy_mask().

◆ sole_alias_of_target()

template<class Resolution, std::meta::info Ns, std::meta::info Alias>
bool welder::detail::sole_alias_of_target ( lang L,
policy_kind pol )
consteval

Is Alias the only participating alias in Ns welding its specialization?

Two aliases naming the same instantiation would register it twice (a framework error at import time); the carriage diagnoses it at compile time instead. A non-participating duplicate (excluded, or not welded under this resolution) is fine — it simply doesn't bind.

Template Parameters
Resolutionthe carriage's resolution policy.
Nsthe namespace being swept.
Aliasthe alias under consideration.
Parameters
Lthe target language.
polthe namespace's policy.
Returns
true iff no other participating alias dealiases to the same type.

Definition at line 54 of file carriage.hpp.

References welder::names_template_specialization().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace().

◆ sole_member_alias_of_target()

template<class Resolution, std::meta::info Outer, std::meta::info Alias>
bool welder::detail::sole_member_alias_of_target ( lang L,
policy_kind pol )
consteval

Is Alias the only member alias of Outer whose participation would register its target?

Two participating member aliases naming the same target would register it twice (a framework load error), diagnosed at compile time — the class-scope twin of sole_alias_of_target. The gate side of participation needs no re-check here: siblings share the target, so when the caller (an alias that IS registering) consults this, a marks/access-participating sibling registers too.

Template Parameters
Resolutionthe carriage's resolution policy.
Outerthe class being bound.
Aliasthe member alias under consideration.
Parameters
Lthe target language.
polthe outer's policy.
Returns
true iff no other participating member alias shares the target.

Definition at line 155 of file carriage.hpp.

References member_access_admitted().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_types().

◆ stl_wrappers()

std::array< wrapper_spec, 18 > welder::detail::stl_wrappers ( )
consteval

The element-wise STL-wrapper table welder recurses into.

See also
wrapper_spec

Definition at line 95 of file bindable.hpp.

Referenced by wrapper_value_count().

◆ weld_as_mask() [1/3]

unsigned welder::detail::weld_as_mask ( )
consteval

The language mask of a weld_as argument list: the OR of its leading lang markers (the trailing name contributes nothing; no markers → 0 = all).

Definition at line 515 of file annotations.hpp.

Referenced by welder::weld_as(), and weld_as_mask().

◆ weld_as_mask() [2/3]

template<size_type N>
unsigned welder::detail::weld_as_mask ( const char(&)[N])
consteval

Definition at line 517 of file annotations.hpp.

◆ weld_as_mask() [3/3]

template<class... Rest>
unsigned welder::detail::weld_as_mask ( lang l,
Rest &&... rest )
consteval

Definition at line 519 of file annotations.hpp.

References welder::lang_bit(), and weld_as_mask().

◆ weld_as_name() [1/2]

template<size_type N>
fixed_string< N > welder::detail::weld_as_name ( const char(&) s[N])
consteval

The verbatim name of a weld_as argument list: the trailing string, reached by dropping the leading lang markers (its extent N preserved by reference).

Definition at line 526 of file annotations.hpp.

Referenced by welder::weld_as(), and weld_as_name().

◆ weld_as_name() [2/2]

template<class... Rest>
auto welder::detail::weld_as_name ( lang ,
Rest &&... rest )
consteval

Definition at line 528 of file annotations.hpp.

References weld_as_name().

◆ wrapper_value_count()

long welder::detail::wrapper_value_count ( std::meta::info type)
consteval

How many leading arguments of type to recurse if it is a listed wrapper.

Parameters
typea reflection of the (possibly wrapped) type.
Returns
the number of leading value arguments (a 0 count in the table expands to all of them); -1 if type is not a listed element-wise wrapper.

Definition at line 116 of file bindable.hpp.

References stl_wrappers().

Referenced by bindable().