51namespace welder::inline v0::rods::python {
84 return !std::meta::annotations_of_with_type(entity, ^^
bind_flat_spec).empty();
129 return !std::meta::annotations_of_with_type(type, ^^
trampoline_spec).empty();
150 for (
auto mem : std::meta::members_of(std::meta::parent_of(base),
151 std::meta::access_context::current())) {
152 if (mem == base || !std::meta::is_type(mem) || !
is_trampoline(mem))
155 std::meta::bases_of(mem, std::meta::access_context::current())) {
156 if (std::meta::dealias(std::meta::type_of(b)) ==
157 std::meta::dealias(base)) {
158 if (result.
type != std::meta::info{})
181 return std::meta::is_function(member) && std::meta::is_virtual(member) &&
182 !std::meta::is_destructor(member) && !
bound_flat(member);
196consteval bool same_slot(std::meta::info a, std::meta::info b) {
197 if (std::meta::identifier_of(a) != std::meta::identifier_of(b))
199 if (std::meta::is_const(a) != std::meta::is_const(b) ||
200 std::meta::is_volatile(a) != std::meta::is_volatile(b) ||
201 std::meta::is_lvalue_reference_qualified(a) !=
202 std::meta::is_lvalue_reference_qualified(b) ||
203 std::meta::is_rvalue_reference_qualified(a) !=
204 std::meta::is_rvalue_reference_qualified(b))
206 auto pa{std::meta::parameters_of(a)};
207 auto pb{std::meta::parameters_of(b)};
208 if (pa.size() != pb.size())
210 for (std::size_t i{0}; i < pa.size(); ++i)
211 if (std::meta::type_of(pa[i]) != std::meta::type_of(pb[i]))
238 std::vector<std::meta::info>& slots) {
240 std::meta::members_of(type, std::meta::access_context::unchecked())) {
241 if (!std::meta::is_function(m) || !std::meta::is_virtual(m) ||
242 std::meta::is_destructor(m) || !std::meta::has_identifier(m))
254 std::meta::bases_of(type, std::meta::access_context::unchecked()))
279 type = std::meta::dealias(type);
280 std::vector<std::meta::info> all{};
282 std::vector<std::meta::info> out{};
284 if (!
bound_flat(s) && !std::meta::is_private(s))
315consteval std::meta::info
virtual_slot(std::meta::info type, std::string_view name,
316 std::meta::info fn_type) {
318 if (std::meta::identifier_of(s) == name &&
319 std::meta::type_of(s) == std::meta::dealias(fn_type))
321 throw ::welder::diag::no_matching_virtual_slot{};
365 scanned.type != std::meta::info{})
387 auto name{std::meta::identifier_of(vfn)};
388 auto sig{std::meta::type_of(vfn)};
390 std::meta::members_of(tramp, std::meta::access_context::unchecked())) {
391 if (std::meta::is_function(m) && !std::meta::is_special_member_function(m) &&
392 std::meta::identifier_of(m) == name && std::meta::type_of(m) == sig) {
welder's consteval diagnostics, collected in one place: every hand-rolled compile-time error the libr...
The stored forms of the annotation vocabulary.
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...
consteval bool same_slot(std::meta::info a, std::meta::info b)
Do a and b declare the same vtable slot?
consteval bool is_overridable_virtual(std::meta::info member)
Is member an overridable virtual — a virtual member function that welder routes through the trampolin...
consteval std::vector< std::meta::info > overridable_virtuals(std::meta::info type)
Every overridable virtual slot of type — the ones welder routes through a trampoline — folding in vir...
consteval std::meta::info virtual_slot(std::meta::info type, std::string_view name, std::meta::info fn_type)
The overridable virtual slot of type named name whose function type is fn_type — the hand-written dis...
consteval bool is_trampoline(std::meta::info type)
Does type carry a trampoline mark?
consteval bool has_virtual_methods(std::meta::info type)
Does type declare or inherit any overridable virtual method?
consteval scanned_trampoline scanned_trampoline_of(std::meta::info base)
Find the trampoline-annotated class deriving directly from base by scanning base's enclosing namespac...
consteval std::size_t virtual_slot_count(std::meta::info type)
The number of overridable virtual member functions of type, inherited ones included.
consteval bool trampoline_covers(std::meta::info type, std::meta::info tramp)
Does tramp override every virtual method of type — inherited ones included?
constexpr bind_flat_spec bind_flat
Mark a virtual entity as deliberately bound non-overridably.
constexpr trampoline_spec trampoline
Mark a class as the trampoline for the base it derives from — the annotation form of trampoline_for.
consteval bool declares_override(std::meta::info tramp, std::meta::info vfn)
Does trampoline declare an override for the virtual method vfn?
consteval std::meta::info construction_type_of()
The type welder constructs when binding T: its registered/annotated trampoline if one exists,...
constexpr std::meta::info trampoline_for
The trampoline subclass registered for T, or a null reflection if none.
consteval bool bound_flat(std::meta::info entity)
Does entity (a type or a member function) carry a bind_flat mark?
The stored form of a bind_flat mark (a plain tag — it carries no state).
The outcome of scanning a base's namespace for its trampoline-annotated subclass.
bool ambiguous
true iff more than one candidate was found.
std::meta::info type
the trampoline, or a null reflection if none found.
The stored form of a trampoline mark (a plain tag — it carries no state).
welder's annotation vocabulary — the single header a consuming TU includes to get the markers it atta...