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  accessor_spec
 The stored form of a getter / setter mark: which property half the function supplies, for which languages, under which (optional) explicit name. More...
struct  any_type
 A placeholder class type for shape-probing a member template inside a concept. More...
struct  container_spec
 One row of the reference-container table: a container template paired with the opaque binder kind it uses. More...
struct  doc_spec
 The stored form of a doc annotation: a summary docstring. More...
struct  enum_doc
 The raw documentation pieces of an enum, handed to a style to assemble. More...
struct  enumerator_doc
 One enumerator's documentation for the enum_doc list: its bound (target-language) name and its doc text. 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  no_reassign_spec
 The stored form of a no_reassign mark: the languages a data member is bound read-only** for, independent of whether its C++ type is const. More...
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  property_entry
 One resolved property: its getter and its (optional) setter. 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  synthesized_comparison
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  cmp_slot : std::uint8_t { lt = 0 , le = 1 , gt = 2 , ge = 3 }
 The rewritten-expression comparison a rod binds for a type whose C++ comparisons come from operator<=>: plain a < b (etc.), so C++'s own operator-rewriting rules ([over.match.oper]) pick the spaceship overload — heterogeneous and reversed operands included — and the target language sees exactly what a C++ caller sees. More...
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 accessor_mask ()
 The language mask of an accessor argument list: the OR of its leading lang markers (a trailing name contributes nothing; none → 0 = all).
template<size_type N>
consteval unsigned accessor_mask (const char(&)[N])
template<class... Rest>
consteval unsigned accessor_mask (lang l, Rest &&... rest)
consteval void accessor_name (char(&)[accessor_name_capacity])
 Copy an accessor argument list's trailing explicit name into dst (left empty when the list carries none — the derive-from-identifier sentinel).
template<size_type N>
consteval void accessor_name (char(&dst)[accessor_name_capacity], const char(&s)[N])
template<class... Rest>
consteval void accessor_name (char(&dst)[accessor_name_capacity], lang, Rest &&... rest)
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 std::size_t trailing_default_count ()
 How many TRAILING parameters of Fn carry a C++ default argument.
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.
consteval bool decays_to (std::meta::info t, std::meta::info type)
 Whether type reflection t is exactly the (welded) type type once stripped of cv/ref qualifiers and aliases.
consteval bool is_free_operator_candidate (std::meta::info f)
 The shape of a bindable freestanding operator: a non-deleted namespace-scope operator function.
consteval bool is_stringifier_for (std::meta::info f, std::meta::info type)
 Whether f is the stream-inserter ("stringifier") shape for type: operator<<(std::ostream&, T).
consteval bool free_operator_anchored (std::meta::info f, std::meta::info type)
 Whether free operator f is anchored on type: some parameter decays to exactly type (an rvalue-reference operand disqualifies — it consumes the object, which no binding call form expresses).
consteval bool free_operator_reflected (std::meta::info f, std::meta::info type)
 Whether anchored free operator f binds reflected for type: type is the right operand and the left is something else (operator*(double, Vec)).
template<auto Fns, std::meta::info Type, bool Reflected>
consteval auto partition_reflected ()
 Split slot group Fns by free_operator_reflected — the entries whose reflectedness equals Reflected, in group order.
consteval std::meta::info enclosing_namespace (std::meta::info type)
 The nearest enclosing namespace of type — the scope its anchored free operators are swept from (for a nested class, the namespace enclosing the outermost class, mirroring where C++ requires such operators to live).
consteval std::meta::info comparison_operand (std::meta::info f, std::meta::info type)
 The operand a comparison synthesized from spaceship overload f takes: the parameter type that is not the anchor type itself — or type for the homogeneous form.
template<auto Fns, std::meta::info Type>
consteval bool has_heterogeneous_comparison ()
 Whether spaceship group Fns contains a heterogeneous overload (an operand that is not Type itself) — the trigger for a reversed-operand fallback on rods whose framework registers by exact signature shape.
template<class T, std::meta::info Fn>
std::string stringify (const T &self)
 The stringifier wrapper every runtime rod binds for a swept ostream inserter (see is_stringifier_for): run the specific participating overload Fn into a string stream and hand back the text — the body of Python's __str__ and Lua's __tostring.
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 an operator function is unary vs binary.
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).
template<class T>
consteval std::size_t aggregate_required_arity ()
 How many leading fields the synthesized aggregate field constructor REQUIRES: everything up to and including the last field without a default member initializer.
template<class T>
consteval std::size_t aggregate_defaults_from ()
 The field index from which a value-extracting backend (the Python rods) can attach the NSDMI defaults as real parameter default values.
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 void collect_member_operators (std::meta::info src, lang L, std::meta::info bound_into, std::vector< std::meta::info > &out)
 Collect the participating member operators visible on bound_into's binding: src's own, preceded by those of its flattened (non-native according to Resolution) bases, recursively — mirroring bind_members' flattening, so a slot's group spans exactly what the class surface exposes.
template<class Resolution>
consteval std::vector< std::meta::info > operator_entries (std::meta::info type, lang L)
 Every participating operator entry of type's binding — member operators (own + flattened bases') and the anchored free operators of the type's enclosing namespace — in one list, so the carriage can slot-group across all sources (a one-value-per-slot backend must receive each slot whole).
template<class Resolution>
consteval std::vector< std::meta::info > operator_slot_set (std::meta::info fn, lang L, std::meta::info bound_into)
 The participating operator entries sharing fn's target slot (same operator and arity — hence the same special-method name) on bound_into's binding, across every source operator_entries sweeps (member + free).
template<class Resolution>
consteval std::vector< std::meta::info > stringifier_entries (std::meta::info type, lang L)
 The participating stringifier entries for type: free operator<<(std::ostream&, T) overloads of its enclosing namespace, resolved like the anchored operators.
template<class Resolution>
consteval std::array< bool, 4 > covered_comparison_slots (std::meta::info type, lang L)
 Which relational slots (lt, le, gt, ge — indexed by cmp_slot) are already covered by an explicit participating operator on type's binding.
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.
template<class Resolution, std::meta::info Type, lang L>
consteval bool copy_ctor_admitted ()
 Whether the resolution admits Type's copy constructor — the marks half of the copy decision; the carriage pairs it with std::is_copy_constructible_v<T> (which also rules out abstract, deleted-copy and inaccessible-copy types) and hands the result to the rod's add_constructors as its Copyable flag.
template<std::meta::info Type>
consteval void validate_move_ctor_marks ()
 Reject an include/only mark on a move constructor of Type.
consteval bool carries_weld_as (std::meta::info m)
 Does m carry a (templated) weld_as annotation?
consteval std::vector< std::string > property_key (std::meta::info mem, accessor_role role, lang L)
 The pairing key of accessor mem's property for language L: the case-normalized word sequence of its explicit name (when the mark carries one) or of its identifier with the leading get/set word stripped.
template<class Resolution>
consteval void collect_accessors (std::meta::info src, lang L, std::meta::info bound_into, std::vector< std::meta::info > &out)
 Collect the participating accessor-marked member functions visible on bound_into's binding: src's own, preceded by its flattened (non-native) bases' — mirroring bind_members' flattening, exactly like collect_member_operators.
template<class Resolution>
consteval void validate_property_shadowing (std::meta::info src, lang L, std::meta::info bound_into, const std::vector< std::vector< std::string > > &keys)
 Guard the property surface against name shadowing: no property's key may equal a bound data member's or (non-accessor) method's identifier key on the same class surface (own + flattened bases).
template<class Resolution>
consteval std::vector< property_entryproperty_entries (std::meta::info type, lang L)
 The resolved properties of type for language L: every participating accessor collected (own + flattened bases), shape-validated, and paired by property key — getters first (in declaration order, which fixes the emission order), then each setter matched to its getter.
template<std::meta::info Getter, lang L, class Style>
consteval const char * property_bound_name ()
 The bound name of the property Getter defines, for language L under name style Style: the mark's explicit name verbatim when present (never styled — the accessor analogue of weld_as), else the getter's identifier styled through Style's field hook (a property is attribute-shaped) with the leading get/set word then stripped in the styled spelling's own convention (see welder::naming::strip_accessor_word).
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.
consteval bool is_expected_specialization (std::meta::info type)
 Is type a std::expected specialization — the fallible-result family?
consteval std::meta::info expected_value_arg (std::meta::info type)
 The VALUE argument of the std::expected type (its first).
consteval bool is_span_specialization (std::meta::info type)
 Is type a std::span specialization — the non-owning sequence view?
consteval std::meta::info span_element_arg (std::meta::info type)
 The ELEMENT argument of the std::span type (its first).
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<class T>
consteval bool mentions_union ()
 Forward declaration: mentions_union() recurses like bindable() does.
template<auto Args, std::size_t... I>
consteval bool args_mention_union (std::index_sequence< I... >)
 Whether every one of a wrapper's value arguments mentions a union.
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<caster_oracle B, std::meta::info Fn, std::meta::info Type, lang L, class Reg, std::size_t... I>
consteval void assert_operands (std::index_sequence< I... >)
 The parameter walk behind assert_operands_bindable — gate each parameter that is not the anchor type itself.
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.
consteval std::array< container_spec, 4 > reference_containers ()
 The containers welder binds opaquely — exactly those the frameworks' bind_vector / bind_map support.
consteval bool same_slot (std::meta::info a, std::meta::info b)
 Do a and b declare the same vtable slot?
consteval void collect_virtuals (std::meta::info type, std::vector< std::meta::info > &slots)
 Accumulate the most-derived declaration of every virtual member function reachable in type's complete object into slots, deduplicating by vtable slot (same_slot — name + parameters + cv/ref, so a covariant override is one slot, not two).

Variables

constexpr size_type accessor_name_capacity {64}
 The inline capacity of an accessor's explicit property name.

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 905 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.

◆ cmp_slot

enum class welder::detail::cmp_slot : std::uint8_t
strong

The rewritten-expression comparison a rod binds for a type whose C++ comparisons come from operator<=>: plain a < b (etc.), so C++'s own operator-rewriting rules ([over.match.oper]) pick the spaceship overload — heterogeneous and reversed operands included — and the target language sees exactly what a C++ caller sees.

The four relational forms are synthesized; == never is (C++ itself only rewrites == from operator==, which a defaulted* spaceship implicitly declares — and that member then binds through the ordinary operator path).

Template Parameters
Athe left operand type.
Bthe right operand type.
Swhich relational slot this wrapper fills.
Enumerator
lt 
le 
gt 
ge 

Definition at line 357 of file bind_traits.hpp.

Function Documentation

◆ accessor_mask() [1/3]

unsigned welder::detail::accessor_mask ( )
consteval

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

Definition at line 339 of file annotations.hpp.

Referenced by accessor_mask(), and welder::detail::accessor_spec::operator()().

◆ accessor_mask() [2/3]

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

Definition at line 341 of file annotations.hpp.

◆ accessor_mask() [3/3]

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

Definition at line 343 of file annotations.hpp.

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

◆ accessor_name() [1/3]

void welder::detail::accessor_name ( char(&) [accessor_name_capacity])
consteval

Copy an accessor argument list's trailing explicit name into dst (left empty when the list carries none — the derive-from-identifier sentinel).

Exceptions
diag::accessor_name_too_long(a constant-evaluation error) when the name exceeds the inline capacity.

Definition at line 351 of file annotations.hpp.

References accessor_name_capacity.

Referenced by accessor_name(), and welder::detail::accessor_spec::operator()().

◆ accessor_name() [2/3]

template<size_type N>
void welder::detail::accessor_name ( char(&) dst[accessor_name_capacity],
const char(&) s[N] )
consteval

Definition at line 353 of file annotations.hpp.

References accessor_name_capacity.

◆ accessor_name() [3/3]

template<class... Rest>
void welder::detail::accessor_name ( char(&) dst[accessor_name_capacity],
lang ,
Rest &&... rest )
consteval

Definition at line 361 of file annotations.hpp.

References accessor_name(), and accessor_name_capacity.

◆ aggregate_defaults_from()

template<class T>
std::size_t welder::detail::aggregate_defaults_from ( )
consteval

The field index from which a value-extracting backend (the Python rods) can attach the NSDMI defaults as real parameter default values.

Stricter than aggregate_required_arity, because extracting a default VALUE — rather than merely omitting the argument — needs two things the arity form doesn't: the whole aggregate must be value-initializable (the defaults are read off a T{} probe instance at registration time; reading an NSDMI's value directly is outside P2996), and each defaulted field must be copy-constructible (the value is copied out of the probe). A field that fails the copy test pushes the start past itself — later fields can still default.

Template Parameters
Tthe aggregate type.
Returns
the first defaultable index (== field count when no default values can be attached; always >= aggregate_required_arity<T>()).

Definition at line 612 of file bind_traits.hpp.

References aggregate_fields(), and aggregate_required_arity().

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

◆ aggregate_fields()

◆ 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 544 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().

◆ aggregate_required_arity()

template<class T>
std::size_t welder::detail::aggregate_required_arity ( )
consteval

How many leading fields the synthesized aggregate field constructor REQUIRES: everything up to and including the last field without a default member initializer.

The trailing fields after that point — all NSDMI'd — are the omissible suffix: aggregate initialization (braced or C++26 parenthesized) fills omitted trailing elements from their NSDMIs, so a backend may expose them as optional (Python keyword defaults, Lua per-arity constructor overloads, LuaCATS ? parameters). An NSDMI'd field before a required one counts as required — a parameter list allows no gaps, exactly like C++ default function arguments.

Template Parameters
Tthe aggregate type.
Returns
the required-prefix length (== field count when nothing is omissible).

Definition at line 582 of file bind_traits.hpp.

References aggregate_fields().

Referenced by welder::rods::luacats::rod::_aggregate_fun_params(), welder::rods::luacats::rod::_aggregate_param_lines(), welder::rods::luabridge::rod::_ctor_arg_lists(), welder::rods::sol2::rod::_ctor_signatures(), and aggregate_defaults_from().

◆ 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 90 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 127 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(), welder::rods::pybind11::rod< DocStyle >::_def_init(), welder::rods::nanobind::rod< DocStyle >::_def_truncated(), and welder::rods::pybind11::rod< DocStyle >::_def_truncated().

◆ 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 201 of file bindable.hpp.

References bindable().

Referenced by bindable().

◆ args_mention_union()

template<auto Args, std::size_t... I>
bool welder::detail::args_mention_union ( std::index_sequence< I... > )
consteval

Whether every one of a wrapper's value arguments mentions a union.

Template Parameters
Argsthe static array of value-argument reflections.
Ithe index pack over Args.

Definition at line 287 of file bindable.hpp.

References mentions_union().

Referenced by mentions_union().

◆ assert_operands()

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

The parameter walk behind assert_operands_bindable — gate each parameter that is not the anchor type itself.

Template Parameters
Bthe rod.
Fnthe spaceship overload.
Typethe anchor type reflection.
Lthe language.
Ithe index pack.

Definition at line 470 of file bindable.hpp.

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

Referenced by welder::assert_operands_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 376 of file bindable.hpp.

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

Referenced by welder::assert_setter_bindable(), and 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 218 of file bindable.hpp.

References args_bindable(), bindable(), expected_value_arg(), is_expected_specialization(), is_span_specialization(), leading_args(), welder::trust_bindable, and wrapper_value_count().

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

◆ carries_weld_as()

bool welder::detail::carries_weld_as ( std::meta::info m)
consteval

Does m carry a (templated) weld_as annotation?

Property machinery diagnoses it on accessors — the explicit accessor name is the rename tool there. Readable off a dynamic reflection (only the template is compared, nothing extracted).

Definition at line 1133 of file bind_traits.hpp.

Referenced by property_entries().

◆ collect_accessors()

template<class Resolution>
void welder::detail::collect_accessors ( std::meta::info src,
lang L,
std::meta::info bound_into,
std::vector< std::meta::info > & out )
consteval

Collect the participating accessor-marked member functions visible on bound_into's binding: src's own, preceded by its flattened (non-native) bases' — mirroring bind_members' flattening, exactly like collect_member_operators.

Template Parameters
Resolutionthe carriage's resolution.
Parameters
srcthe class whose members to collect (a base during recursion).
Lthe target language.
bound_intothe welded type whose binding receives the properties.
outthe collection target (bases append first).

Definition at line 1168 of file bind_traits.hpp.

References collect_accessors(), welder::is_accessor_for(), is_method_candidate(), member_access_admitted(), welder::policy_of(), and welder::public_bases().

Referenced by collect_accessors(), and property_entries().

◆ collect_member_operators()

template<class Resolution>
void welder::detail::collect_member_operators ( std::meta::info src,
lang L,
std::meta::info bound_into,
std::vector< std::meta::info > & out )
consteval

Collect the participating member operators visible on bound_into's binding: src's own, preceded by those of its flattened (non-native according to Resolution) bases, recursively — mirroring bind_members' flattening, so a slot's group spans exactly what the class surface exposes.

Each candidate passes access admission and the resolution under its declaring* class's policy.

Template Parameters
Resolutionthe carriage's resolution.
Parameters
srcthe class whose members to collect (a base during recursion).
Lthe target language.
bound_intothe welded type whose binding receives the operators.
outthe collection target (bases append first).

Definition at line 757 of file bind_traits.hpp.

References collect_member_operators(), is_operator_candidate(), member_access_admitted(), welder::policy_of(), and welder::public_bases().

Referenced by collect_member_operators(), and operator_entries().

◆ 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 1347 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().

◆ collect_virtuals()

void welder::detail::collect_virtuals ( std::meta::info type,
std::vector< std::meta::info > & slots )
consteval

Accumulate the most-derived declaration of every virtual member function reachable in type's complete object into slots, deduplicating by vtable slot (same_slot — name + parameters + cv/ref, so a covariant override is one slot, not two).

members_of lists a class's own members only, so a virtual a subclass merely inherits is invisible there — the reason a whole-hierarchy walk is needed. type's own members are visited before its bases, so the first declaration recorded for a given slot is the most-derived one; a base's re-declaration of an already-seen slot is skipped. Members are enumerated with access_context::unchecked() (like the rest of welder's core): a protected virtual — the NVI/template-method hook — is a real overridable slot even though it is never bound (Python overrides it via attribute lookup, which needs no binding). Neither bind_flat nor access is filtered here — a private declaration still claims its slot in the dedup, and the filters are applied by overridable_virtuals on the kept most-derived declaration. So a subclass can un-flatten a virtual its base marked bind_flat (and vice versa), and privatizing an inherited virtual withdraws the slot rather than resurrecting the base's public declaration.

Parameters
typea reflection of the class type.
slotsthe accumulator of most-derived virtual declarations.

Definition at line 135 of file virtuals.hpp.

References collect_virtuals(), and same_slot().

Referenced by collect_virtuals(), and welder::overridable_virtuals().

◆ comparison_operand()

std::meta::info welder::detail::comparison_operand ( std::meta::info f,
std::meta::info type )
consteval

The operand a comparison synthesized from spaceship overload f takes: the parameter type that is not the anchor type itself — or type for the homogeneous form.

Parameters
fa reflection of an operator<=> overload (member or anchored free).
typethe anchor type.
Returns
the operand's declared type reflection.

Definition at line 324 of file bind_traits.hpp.

References decays_to().

Referenced by welder::rods::luabridge::rod::_cmp_dispatch(), has_heterogeneous_comparison(), and welder::rods::python::synthesize_comparisons().

◆ copy_ctor_admitted()

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

Whether the resolution admits Type's copy constructor — the marks half of the copy decision; the carriage pairs it with std::is_copy_constructible_v<T> (which also rules out abstract, deleted-copy and inaccessible-copy types) and hands the result to the rod's add_constructors as its Copyable flag.

A copy constructor never binds as an init overload (see is_bindable_constructor); its target-language spelling is the rod's — the Python rods emit __copy__/__deepcopy__ over it, the Lua rods ignore it (Lua has no copy protocol).

Mirrors default_ctor_admitted exactly: the copy constructor may be implicit* — no declaration, so no marks and nothing for opt_in to filter: admitted whenever the type is copy-constructible. A declared copy constructor is consulted under policy_kind::automatic — its explicit marks are honored (so [[=welder::mark::exclude]] T(const T&); suppresses the copy binding, per language when the mark is scoped), but opt_in's default-out is not: you cannot include an implicit constructor, so filtering the declared spelling by default would make T(const 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 1072 of file bind_traits.hpp.

References welder::automatic.

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

◆ covered_comparison_slots()

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

Which relational slots (lt, le, gt, ge — indexed by cmp_slot) are already covered by an explicit participating operator on type's binding.

Comparison synthesis from operator<=> fills only the uncovered slots: an explicit operator beats synthesis (mirroring C++ overload resolution's preference for non-rewritten candidates), and a slot is skipped whole so a one-value-per-slot backend never sees two writers.

Template Parameters
Resolutionthe carriage's resolution.
Parameters
typethe welded type.
Lthe target language.
Returns
covered flags, indexed by cmp_slot.

Definition at line 853 of file bind_traits.hpp.

References is_unary_operator(), and operator_entries().

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

◆ 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 1004 of file bind_traits.hpp.

References is_bindable_constructor().

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

◆ decays_to()

bool welder::detail::decays_to ( std::meta::info t,
std::meta::info type )
consteval

Whether type reflection t is exactly the (welded) type type once stripped of cv/ref qualifiers and aliases.

The anchor test — exact identity, never a base: a base-anchored free operator rides through the target language's class inheritance when the base is welded.

Parameters
ta type reflection (possibly qualified / aliased).
typethe plain type to compare against.
Returns
true iff t decays to type.

Definition at line 209 of file bind_traits.hpp.

Referenced by comparison_operand(), free_operator_anchored(), free_operator_reflected(), has_heterogeneous_comparison(), and is_stringifier_for().

◆ 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 1040 of file bind_traits.hpp.

References welder::automatic.

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

◆ enclosing_namespace()

std::meta::info welder::detail::enclosing_namespace ( std::meta::info type)
consteval

The nearest enclosing namespace of type — the scope its anchored free operators are swept from (for a nested class, the namespace enclosing the outermost class, mirroring where C++ requires such operators to live).

Parameters
typea reflection of the type.
Returns
the enclosing namespace reflection.

Definition at line 311 of file bind_traits.hpp.

Referenced by operator_entries(), and stringifier_entries().

◆ 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 651 of file bind_traits.hpp.

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

Referenced by namespace_has_bound().

◆ expected_value_arg()

std::meta::info welder::detail::expected_value_arg ( std::meta::info type)
consteval

The VALUE argument of the std::expected type (its first).

Parameters
typea reflection of the expected specialization.

Definition at line 168 of file bindable.hpp.

Referenced by bindable().

◆ free_operator_anchored()

bool welder::detail::free_operator_anchored ( std::meta::info f,
std::meta::info type )
consteval

Whether free operator f is anchored on type: some parameter decays to exactly type (an rvalue-reference operand disqualifies — it consumes the object, which no binding call form expresses).

The stringifier shape is excluded (it has its own route).

Parameters
fa reflection of the function.
typethe candidate anchor type.
Returns
true iff f participates in type's operator sweep.

Definition at line 251 of file bind_traits.hpp.

References decays_to(), is_free_operator_candidate(), and is_stringifier_for().

Referenced by operator_entries().

◆ free_operator_reflected()

bool welder::detail::free_operator_reflected ( std::meta::info f,
std::meta::info type )
consteval

Whether anchored free operator f binds reflected for type: type is the right operand and the left is something else (operator*(double, Vec)).

The Python rods bind such an entry under the reflected dunder (__rmul__, or the operand-swapped comparison); the Lua rods need no distinction (a metamethod receives the operands as passed).

Parameters
fa reflection of the anchored operator.
typethe anchor type.
Returns
true iff type is only the right operand.

Definition at line 270 of file bind_traits.hpp.

References decays_to().

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

◆ 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 889 of file bind_traits.hpp.

References welder::policy_of().

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

◆ has_heterogeneous_comparison()

template<auto Fns, std::meta::info Type>
bool welder::detail::has_heterogeneous_comparison ( )
consteval

Whether spaceship group Fns contains a heterogeneous overload (an operand that is not Type itself) — the trigger for a reversed-operand fallback on rods whose framework registers by exact signature shape.

Template Parameters
Fnsthe spaceship group.
Typethe anchor type's reflection.
Returns
true iff some overload compares against another type.

Definition at line 339 of file bind_traits.hpp.

References comparison_operand(), and decays_to().

Referenced by welder::rods::luabridge::rod::_add_synth_cmp().

◆ 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), as is the copy constructor — it has a target-language spelling of its own (copy_ctor_admitted; Python __copy__/__deepcopy__), never an init overload. Move constructors never bind at all (no target language has move semantics; a marked one is diagnosed — validate_move_ctor_marks).

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 147 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 637 of file bind_traits.hpp.

Referenced by entity_bound(), and namespace_has_bindable().

◆ is_expected_specialization()

bool welder::detail::is_expected_specialization ( std::meta::info type)
consteval

Is type a std::expected specialization — the fallible-result family?

Deliberately NOT a row in stl_wrappers — that table's contract is that every leading argument it names is value-bearing, and std::expected's two arguments are not alike — T crosses, E does not. It gets its own branch in bindable instead.

Parameters
typea reflection of the cv/ref/pointer-stripped type.

Definition at line 161 of file bindable.hpp.

Referenced by bindable().

◆ is_free_operator_candidate()

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

The shape of a bindable freestanding operator: a non-deleted namespace-scope operator function.

Participation is still the resolution's call (under the anchor type's policy, with the operator's own marks).

Parameters
fa reflection of the function.
Returns
true iff f is a non-deleted namespace-scope operator.

Definition at line 219 of file bind_traits.hpp.

Referenced by free_operator_anchored(), and is_stringifier_for().

◆ 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 169 of file bind_traits.hpp.

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

◆ 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 187 of file bind_traits.hpp.

Referenced by collect_member_operators().

◆ 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 936 of file bind_traits.hpp.

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

◆ is_span_specialization()

bool welder::detail::is_span_specialization ( std::meta::info type)
consteval

Is type a std::span specialization — the non-owning sequence view?

Also kept OUT of stl_wrappers, for a different reason than std::expected: a span is element-wise, but adding the row would make the gate recurse into the element for EVERY rod, and the Python rods reach spans through a whole-type caster today (nanobind has no converter for, say, a bare std::byte element). Recursing behind the native-caster check keeps that path byte-for-byte unchanged while letting a rod without such a caster still admit the span by its element.

Parameters
typea reflection of the cv/ref/pointer-stripped type.

Definition at line 182 of file bindable.hpp.

Referenced by bindable().

◆ is_stringifier_for()

bool welder::detail::is_stringifier_for ( std::meta::info f,
std::meta::info type )
consteval

Whether f is the stream-inserter ("stringifier") shape for type: operator<<(std::ostream&, T).

Never bound as a shift slot — a rod maps it to the target's to-string protocol (Python __str__, Lua __tostring), so the std::ostream& parameter is deliberately not gated for bindability.

Parameters
fa reflection of the function.
typethe anchor type.
Returns
true iff f is type's ostream inserter.

Definition at line 231 of file bind_traits.hpp.

References decays_to(), and is_free_operator_candidate().

Referenced by free_operator_anchored(), and stringifier_entries().

◆ is_unary_operator()

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

Whether an operator function is unary vs binary.

Told apart by arity — this disambiguates the operators with both forms (+, -); backends use it to pick, e.g., __neg__ vs __sub__. A non-static member operator's left operand is the implicit object (unary = 0 parameters); a namespace-scope (or static member) operator spells both operands out (unary = 1 parameter).

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

Definition at line 493 of file bind_traits.hpp.

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

◆ 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 105 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(), welder::rods::pybind11::rod< DocStyle >::_def_function(), welder::rods::nanobind::rod< DocStyle >::_def_operator(), welder::rods::pybind11::rod< DocStyle >::_def_operator(), welder::rods::nanobind::rod< DocStyle >::add_operator(), and welder::rods::pybind11::rod< DocStyle >::add_operator().

◆ 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 143 of file bindable.hpp.

Referenced by bindable(), and mentions_union().

◆ 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 957 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 428 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(), collect_accessors(), collect_member_operators(), method_overload_set(), nested_type_registered(), registered_by_member_alias(), sole_member_alias_of_target(), and validate_property_shadowing().

◆ mentions_union()

template<class T>
bool welder::detail::mentions_union ( )
consteval

Forward declaration: mentions_union() recurses like bindable() does.

Does T — stripped exactly as bindable() strips — name a union anywhere: itself, or as a value argument of a listed STL wrapper (std::vector<U>, std::optional<U>, …)?

Used only to pick the right diagnostic once bindable() has already said no: a failure caused by a union gets the union-specific message (whose remedy is std::variant, not "weld it" — welding a union is itself an error). The trust/native-caster short-circuits need no mirroring here: when they apply, bindable() is true and no assert consults this.

Definition at line 301 of file bindable.hpp.

References args_mention_union(), leading_args(), and wrapper_value_count().

Referenced by args_mention_union(), and welder::assert_bindable().

◆ 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.

An accessor-marked overload (a getter/setter covering L) is not a method — it binds as a property — so it never joins the group (nor leads one: the carriage's method sweep skips it symmetrically).

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 727 of file bind_traits.hpp.

References welder::is_accessor_for(), 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 690 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 665 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 1374 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 132 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_entries()

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

Every participating operator entry of type's binding — member operators (own + flattened bases') and the anchored free operators of the type's enclosing namespace — in one list, so the carriage can slot-group across all sources (a one-value-per-slot backend must receive each slot whole).

A free operator resolves like a member of its anchor: the type's policy plus the operator's own marks, through class_member_participates with the type as bound_into. The stringifier shape is excluded (see stringifier_entries); spaceship entries are included (the carriage routes them to comparison synthesis, never to a direct slot).

Template Parameters
Resolutionthe carriage's resolution.
Parameters
typethe welded type.
Lthe target language.
Returns
the entries, flattened bases first, then own members, then free.

Definition at line 786 of file bind_traits.hpp.

References collect_member_operators(), enclosing_namespace(), free_operator_anchored(), and welder::policy_of().

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_operators(), covered_comparison_slots(), and operator_slot_set().

◆ operator_slot_set()

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

The participating operator entries sharing fn's target slot (same operator and arity — hence the same special-method name) on bound_into's binding, across every source operator_entries sweeps (member + free).

Matches the overload_selector shape so overload_group / is_overload_leader drive it like the other selectors.

Template Parameters
Resolutionthe carriage's resolution.
Parameters
fna reflection of one participating entry.
Lthe target language.
bound_intothe welded type whose binding receives the group.
Returns
the slot's group (always contains fn).

Definition at line 810 of file bind_traits.hpp.

References is_unary_operator(), and operator_entries().

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

◆ 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 916 of file bind_traits.hpp.

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

◆ 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 80 of file bind_traits.hpp.

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

◆ 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 42 of file bind_traits.hpp.

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

◆ partition_reflected()

template<auto Fns, std::meta::info Type, bool Reflected>
auto welder::detail::partition_reflected ( )
consteval

Split slot group Fns by free_operator_reflected — the entries whose reflectedness equals Reflected, in group order.

A rod whose framework registers by exact signature shape (LuaBridge3) uses this to route the direct (anchor-on-the-left) entries through its typed registration and the reflected ones through a raw fallback.

Template Parameters
Fnsthe slot group (a static array of reflections).
Typethe anchor type's reflection.
Reflectedwhich partition to keep.
Returns
the matching entries as a static array.

Definition at line 287 of file bind_traits.hpp.

References free_operator_reflected().

Referenced by welder::rods::luabridge::rod::add_operator().

◆ property_bound_name()

template<std::meta::info Getter, lang L, class Style>
const char * welder::detail::property_bound_name ( )
consteval

The bound name of the property Getter defines, for language L under name style Style: the mark's explicit name verbatim when present (never styled — the accessor analogue of weld_as), else the getter's identifier styled through Style's field hook (a property is attribute-shaped) with the leading get/set word then stripped in the styled spelling's own convention (see welder::naming::strip_accessor_word).

Template Parameters
Getterthe property's getter reflection (the authoritative name source).
Lthe target language.
Stylethe name style.
Returns
the bound property name, in static storage.

Definition at line 1316 of file bind_traits.hpp.

References welder::accessor_explicit_name(), welder::getter, and welder::naming::strip_accessor_word().

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

◆ property_entries()

template<class Resolution>
std::vector< property_entry > welder::detail::property_entries ( std::meta::info type,
lang L )
consteval

The resolved properties of type for language L: every participating accessor collected (own + flattened bases), shape-validated, and paired by property key — getters first (in declaration order, which fixes the emission order), then each setter matched to its getter.

Validation (each a designed constant-evaluation error, see <welder/diag.hpp>): a getter must be a const member function with no parameters and a non-void return; a setter takes exactly one parameter; one function cannot supply both halves for one language; static and virtual accessors are rejected (deferred / unsupported); weld_as on an accessor conflicts with the explicit accessor name; two getters (or setters) per property, or a setter with no getter, are errors; and no property may shadow a bound member's name (see validate_property_shadowing).

Template Parameters
Resolutionthe carriage's resolution.
Parameters
typethe welded type.
Lthe target language.
Returns
the properties, one entry per resolved name.

Definition at line 1245 of file bind_traits.hpp.

References welder::accessor_marked(), carries_weld_as(), collect_accessors(), welder::getter, property_key(), welder::setter, and validate_property_shadowing().

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

◆ property_key()

std::vector< std::string > welder::detail::property_key ( std::meta::info mem,
accessor_role role,
lang L )
consteval

The pairing key of accessor mem's property for language L: the case-normalized word sequence of its explicit name (when the mark carries one) or of its identifier with the leading get/set word stripped.

Parameters
mema reflection of the accessor function.
rolewhich property half mem supplies.
Lthe target language.
Returns
the property's lower-cased words.

Definition at line 1150 of file bind_traits.hpp.

References welder::accessor_explicit_name(), welder::naming::accessor_property_words(), and welder::naming::split_words().

Referenced by property_entries().

◆ reference_containers()

std::array< container_spec, 4 > welder::detail::reference_containers ( )
consteval

The containers welder binds opaquely — exactly those the frameworks' bind_vector / bind_map support.

Add a row only when both Python frameworks ship a binder for it (a deque/set/list/multimap would need welder to synthesize the Python protocol — pybind11's bind_vector alone already rejects std::deque, which lacks .reserve()).

std::array<T, N> is the exception that welder does synthesize: neither framework ships a bind_array, but a fixed-size contiguous sequence is small and its protocol is the vector's minus the size-changing ops, so the rods hand-write it (container_kind::fixed_sequence). It binds by reference like a vector — element write-through, a zero-copy NumPy view for arithmetic/POD elements — with append/ resize absent and a length-changing whole assignment rejected.

Definition at line 73 of file containers.hpp.

References welder::fixed_sequence, welder::map, and welder::sequence.

Referenced by welder::container_kind_of(), and welder::is_reference_container().

◆ 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 187 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 779 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 777 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 771 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 769 of file annotations.hpp.

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

◆ same_slot()

bool welder::detail::same_slot ( std::meta::info a,
std::meta::info b )
consteval

Do a and b declare the same vtable slot?

Slot identity is the name plus everything overriding keys off: the parameter types and the cv / ref qualifiers. The return type is deliberately excluded — a covariant override (Derived* clone() over Base* clone()) redeclares the same slot with a narrower return, and comparing full type_of would count it as a second slot. noexcept is excluded for the same reason: an override may strengthen* the exception specification, and two overloads cannot differ by noexcept alone, so it can never distinguish genuine slots.

Definition at line 94 of file virtuals.hpp.

Referenced by collect_virtuals().

◆ 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 55 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 156 of file carriage.hpp.

References member_access_admitted().

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

◆ span_element_arg()

std::meta::info welder::detail::span_element_arg ( std::meta::info type)
consteval

The ELEMENT argument of the std::span type (its first).

Parameters
typea reflection of the span specialization.

Definition at line 189 of file bindable.hpp.

◆ 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 105 of file bindable.hpp.

Referenced by wrapper_value_count().

◆ stringifier_entries()

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

The participating stringifier entries for type: free operator<<(std::ostream&, T) overloads of its enclosing namespace, resolved like the anchored operators.

At most one is bound (the target to-string protocols take no second operand — cv-variant duplicates would collide), so the carriage emits entry [0].

Template Parameters
Resolutionthe carriage's resolution.
Parameters
typethe welded type.
Lthe target language.
Returns
the participating inserter reflections, in declaration order.

Definition at line 830 of file bind_traits.hpp.

References enclosing_namespace(), is_stringifier_for(), and welder::policy_of().

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

◆ stringify()

template<class T, std::meta::info Fn>
std::string welder::detail::stringify ( const T & self)

The stringifier wrapper every runtime rod binds for a swept ostream inserter (see is_stringifier_for): run the specific participating overload Fn into a string stream and hand back the text — the body of Python's __str__ and Lua's __tostring.

Template Parameters
Tthe welded type.
Fnthe inserter's reflection.
Parameters
selfthe object to stringify.
Returns
the inserted text.

Definition at line 384 of file bind_traits.hpp.

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

◆ trailing_default_count()

template<std::meta::info Fn>
std::size_t welder::detail::trailing_default_count ( )
consteval

How many TRAILING parameters of Fn carry a C++ default argument.

The count is what a binding can act on: P2996 exposes that a default EXISTS (has_default_argument) but not the defaulting expression itself, so a rod cannot re-state the value — it can, however, bind one truncated overload per omissible arity that calls the function with fewer arguments and lets the LANGUAGE apply the real default at the call site. That keeps the bound default and the C++ default incapable of drifting apart.

Template Parameters
Fna reflection of the function (or constructor).
Returns
the number of trailing defaulted parameters.

Definition at line 62 of file bind_traits.hpp.

Referenced by welder::rods::nanobind::rod< DocStyle >::add_constructors(), welder::rods::pybind11::rod< DocStyle >::add_constructors(), welder::rods::nanobind::rod< DocStyle >::add_function(), welder::rods::pybind11::rod< DocStyle >::add_function(), welder::rods::nanobind::rod< DocStyle >::add_method(), welder::rods::pybind11::rod< DocStyle >::add_method(), welder::rods::nanobind::rod< DocStyle >::add_static_method(), and welder::rods::pybind11::rod< DocStyle >::add_static_method().

◆ validate_move_ctor_marks()

template<std::meta::info Type>
void welder::detail::validate_move_ctor_marks ( )
consteval

Reject an include/only mark on a move constructor of Type.

Move construction never crosses a language boundary — no target language has move semantics — so a move constructor is skipped structurally everywhere (it is not a bindable-shape constructor, and the copy decision never consults it). An include or only mark on one is therefore an intent welder cannot honor: diagnosed as a hard error rather than silently dropped. mark::exclude stays a harmless no-op (excluding what never binds restricts nothing).

Template Parameters
Typethe class type reflection.
Exceptions
diag::marked_move_constructor(a constant-evaluation error) on a marked move constructor.

Definition at line 1099 of file bind_traits.hpp.

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

◆ validate_property_shadowing()

template<class Resolution>
void welder::detail::validate_property_shadowing ( std::meta::info src,
lang L,
std::meta::info bound_into,
const std::vector< std::vector< std::string > > & keys )
consteval

Guard the property surface against name shadowing: no property's key may equal a bound data member's or (non-accessor) method's identifier key on the same class surface (own + flattened bases).

Keys are case-normalized word sequences, so the comparison is deliberately convention-insensitive — a property and a member differing only in spelling convention collide under any styled binding. Nested types are exempt (a PascalCase nested type legitimately shares its words with a camel/snake property).

Template Parameters
Resolutionthe carriage's resolution.
Parameters
srcthe class to scan (a base during recursion).
Lthe target language.
bound_intothe welded type.
keysthe property keys to check against.
Exceptions
diag::property_name_collisionon a clash.

Definition at line 1198 of file bind_traits.hpp.

References welder::is_accessor_for(), is_method_candidate(), member_access_admitted(), welder::policy_of(), welder::public_bases(), welder::naming::split_words(), and validate_property_shadowing().

Referenced by property_entries(), and validate_property_shadowing().

◆ 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 702 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 704 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 706 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 713 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 715 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 126 of file bindable.hpp.

References stl_wrappers().

Referenced by bindable(), and mentions_union().

Variable Documentation

◆ accessor_name_capacity

size_type welder::detail::accessor_name_capacity {64}
inlineconstexpr

The inline capacity of an accessor's explicit property name.

Unlike weld_as_spec, the accessor spec is not templated on the name length: the resolution machinery reads accessor marks off dynamic reflections (inside member_bound and the overload-set selectors, where the member is a plain std::meta::info value, not a template argument), and std::meta::extract needs the annotation's exact type spelled statically — which a length-templated spec cannot provide there. A fixed-capacity inline buffer keeps the spec one extractable type; the factory diagnoses an over-long name at the annotation site.

Definition at line 328 of file annotations.hpp.

Referenced by accessor_name(), accessor_name(), and accessor_name().