|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
The contract a resolution — the carriage's which-participates policy — must satisfy to be injected as welder::carriages::basic_carriage's Resolution argument. More...
#include <welder/concepts.hpp>
The contract a resolution — the carriage's which-participates policy — must satisfy to be injected as welder::carriages::basic_carriage's Resolution argument.
A carriage separates three concerns: which entities participate (the reading of welder's markers — the resolution's job), how they are emitted (the welder::rod), and whether they are representable (the bindability gate, shared). A resolution R is a stateless struct of static consteval predicates the carriage consults as it walks a reflected type or namespace. Two ship — marker_resolution (honor weld/policy/marks — the default welder::stitch_welding_carriage) and greedy_resolution (ignore the markers, bind an unmarked library greedily — welder::tack_welding_carriage) — and a user may inject a bespoke one.
Predicates** (each static consteval, mirroring the carriage's call sites). Every per-member predicate takes a trailing std::meta::info bound_into — the entity whose binding receives the decision's subject — as bespoke-rule context: the welded type for class members (held fixed through the base-flattening recursion, so it differs from parent_of(mem) exactly when a non-welded base's member is flattened onto a derived binding), the swept namespace for namespace members, the parent namespace for a nested namespace, the type whose direct base list is being walked for is_native_base. The shipped resolutions ignore it.
Plus one reflection-templated hook — it takes the derived type and a lang as non-type template arguments:
Optional hook** (detected via requires, so the concept does not demand it):
A concept cannot quantify over every T, so — exactly as welder::caster_oracle probes has_native_caster — this probes native_bases with the single placeholder welder::detail::any_type and checks only its shape (that the hook exists and yields a range of std::meta::info). The actual per-type instantiation is still exercised at the carriage's call site.
| R | the candidate resolution type. |
Definition at line 337 of file concepts.hpp.