38namespace welder::inline v0 {
54template <
class Resolution, std::meta::info Ns, std::meta::info Alias>
57 std::meta::members_of(Ns, std::meta::access_context::unchecked())) {
64 if (std::meta::identifier_of(m) == std::meta::identifier_of(Alias))
66 if (std::meta::dealias(m) == std::meta::dealias(Alias) &&
67 Resolution::alias_participates(m, L, pol, Ns))
88template <std::meta::info Alias,
lang L,
class Style,
107 const std::meta::info outer{std::meta::parent_of(type)};
108 return std::meta::is_type(outer) && std::meta::is_class_type(outer);
131template <
class Resolution>
133 const std::meta::info outer{std::meta::parent_of(type)};
134 return std::meta::has_identifier(type) && std::meta::is_complete_type(type) &&
137 Resolution::counts_as_registered(outer, L);
155template <
class Resolution, std::meta::info Outer, std::meta::info Alias>
157 for (
auto m : std::meta::members_of(Outer,
158 std::meta::access_context::unchecked())) {
159 if (!std::meta::is_type_alias(m) || !std::meta::has_identifier(m))
163 if (std::meta::identifier_of(m) == std::meta::identifier_of(Alias))
165 if (std::meta::dealias(m) == std::meta::dealias(Alias) &&
167 Resolution::class_member_participates(m, L, pol, Outer))
186template <
class Resolution>
188 std::meta::info type,
lang L) {
190 for (
auto m : std::meta::members_of(scope,
191 std::meta::access_context::unchecked())) {
192 if (!std::meta::is_type_alias(m) || !std::meta::has_identifier(m))
194 if (std::meta::dealias(m) != type)
197 Resolution::class_member_participates(m, L, pol, scope))
221template <
class Resolution, std::meta::info Scope>
224 if (Resolution::counts_as_registered(type, L))
226 if (!(std::meta::is_class_type(type) || std::meta::is_enum_type(type)))
268 template <std::meta::info T, lang L>
334 if ((std::meta::is_class_type(type) || std::meta::is_enum_type(type)) &&
364template <
bool WeldProtected = false>
371 template <std::meta::info, lang>
373 return std::array<std::meta::info, 0>{};
401 return WeldProtected ||
434 if (!(std::meta::is_class_type(type) || std::meta::is_enum_type(type)))
436 if (!std::meta::is_complete_type(type))
467template <resolution Resolution>
489 template <
rod B, std::meta::info BoundInto, std::meta::info Src,
class Style,
492 constexpr lang L{B::language};
493 constexpr auto ctx{std::meta::access_context::unchecked()};
495 template for (
constexpr auto base :
497 if constexpr (!Resolution::is_native_base(base, L, Src))
508 template for (
constexpr auto mem : std::define_static_array(
509 std::meta::nonstatic_data_members_of(Src, ctx))) {
516 if constexpr (std::meta::has_identifier(mem) &&
519 Resolution::class_member_participates(mem, L, pol,
522 B::template add_field<mem, Style>(cls);
532 template for (
constexpr auto mem :
533 std::define_static_array(std::meta::members_of(Src, ctx))) {
535 !((std::meta::is_type(mem) || std::meta::is_function(mem) ||
536 std::meta::is_variable(mem)) &&
537 !std::meta::is_nonstatic_data_member(mem) &&
539 "welder: [[=welder::mark::no_reassign]] applies to a nonstatic data "
540 "member only — it forces that member's read-only binding, which has "
541 "no meaning on a method, constructor, static member, or nested type");
553 template for (
constexpr auto fn :
554 std::define_static_array(std::meta::members_of(Src, ctx))) {
562 Resolution::class_member_participates(fn, L, pol,
570 template for (
constexpr auto member :
571 std::define_static_array(grp)) {
574 if constexpr (std::meta::is_static_member(fn))
575 B::template add_static_method<grp, Style>(cls);
577 B::template add_method<grp, Style>(cls);
597 template <rod B,
class E,
class Style,
class EnumHandle>
599 constexpr lang L{B::language};
601 template for (
constexpr auto en :
602 std::define_static_array(std::meta::enumerators_of(^^E))) {
603 if constexpr (Resolution::class_member_participates(en, L, pol, ^^E))
604 B::template add_enumerator<en, Style>(e);
624 template <rod B,
class E,
class Style>
626 constexpr lang L{B::language};
628 std::vector<welder::detail::enumerator_doc> out{};
629 template for (
constexpr auto en :
630 std::define_static_array(std::meta::enumerators_of(^^E))) {
631 if constexpr (Resolution::class_member_participates(en, L, pol, ^^E)) {
633 if constexpr (text !=
nullptr)
635 {welder::name_of<en, L, Style, ent_kind::enumerator>(), text});
657 template <rod B,
class T,
class Style,
class Cls>
659 constexpr lang L{B::language};
688 constexpr bool has_default{
690 if constexpr (
requires {
691 typename B::template construction_type<T>;
693 return std::is_default_constructible_v<
694 typename B::template construction_type<T>>;
696 return std::is_default_constructible_v<T>;
699 constexpr auto ctors{
701 template for (
constexpr auto ctor : std::define_static_array(ctors)) {
707 constexpr bool aggregate{
718 has_default || aggregate || ctors.size() != 0 ||
722 "welder: policy filtering left this type with NO constructor — it "
723 "would be silently uninstantiable from the target language. Mark a "
724 "constructor [[=welder::mark::include]] (opt_in binds only marked "
725 "members, constructors included), or mark them all "
726 "[[=welder::mark::exclude]] to make a factory-only surface explicit. "
727 "The type is the T of this bind_type<B, T, Style> instantiation.");
728 constexpr bool copyable{
729 std::is_copy_constructible_v<T> &&
734 if constexpr (
requires {
735 B::template add_constructors<T, ctors, has_default,
739 B::template add_constructors<T, ctors, has_default, aggregate,
740 copyable, Style>(cls);
742 B::template add_constructors<T, ctors, has_default, aggregate,
769 template <rod B,
class T,
class Style,
class Cls>
771 constexpr lang L{B::language};
773 template for (
constexpr auto p :
774 std::define_static_array(
780 if constexpr (p.setter != std::meta::info{})
782 B::template add_property<T, p.getter, p.setter>(
812 template <rod B,
class T,
class Cls>
814 constexpr lang L{B::language};
817 template for (
constexpr auto fn :
818 std::define_static_array(
820 if constexpr (std::meta::operator_of(fn) ==
821 std::meta::operators::op_spaceship) {
827 template for (
constexpr auto member :
828 std::define_static_array(grp)) {
832 B::template add_comparisons<
837 }
else if constexpr (B::special_method_name(fn) !=
nullptr) {
843 template for (
constexpr auto member :
844 std::define_static_array(grp)) {
847 B::template add_operator<T, grp>(cls);
856 constexpr auto strs{std::define_static_array(
858 if constexpr (strs.size() != 0)
859 B::template add_stringifier<T, strs[0]>(cls);
891 template <rod B, std::meta::info Outer,
class Style,
class Cls>
893 constexpr lang L{B::language};
894 constexpr auto ctx{std::meta::access_context::unchecked()};
896 template for (
constexpr auto mem : std::define_static_array(
897 std::meta::members_of(Outer, ctx))) {
898 if constexpr (std::meta::is_type(mem) &&
899 !std::meta::is_type_alias(mem) &&
900 (std::meta::is_class_type(mem) ||
901 std::meta::is_enum_type(mem)) &&
902 std::meta::has_identifier(mem) &&
903 std::meta::is_complete_type(mem)) {
906 Resolution::class_member_participates(mem, L, pol,
908 if constexpr (std::meta::is_enum_type(mem))
913 }
else if constexpr (std::meta::is_type_alias(mem) &&
914 std::meta::has_identifier(mem) &&
915 (std::meta::is_class_type(
916 std::meta::dealias(mem)) ||
917 std::meta::is_enum_type(
918 std::meta::dealias(mem))) &&
919 std::meta::is_complete_type(
920 std::meta::dealias(mem))) {
935 "welder: only weld_as / exclude / include / only may be "
936 "attached to a member type alias; policy and doc marks "
937 "belong on the target type, and weld / trust_bindable have "
938 "no meaning here (participation follows the outer's policy "
939 "and the bindability gate)");
942 Resolution::class_member_participates(mem, L, pol,
945 B,
typename [:std::meta::dealias(mem):], L,
950 "welder: two member aliases in this class weld the SAME "
951 "target type — each target may be registered under "
952 "exactly one name; mark::exclude one of them");
953 if constexpr (std::meta::is_enum_type(
954 std::meta::dealias(mem)))
996 template <
rod B,
class T,
class Style, std::meta::info Decl = std::meta::info{},
999 const char* name =
nullptr) {
1000 constexpr lang L{B::language};
1004 const char* cls_name{
1007 Resolution::template native_bases<^^T, L>()>(
1016 if constexpr (
requires {
1017 B::template finish_nested_class<T>(m, outer, cls,
1020 B::template finish_nested_class<T>(m, outer, cls, cls_name);
1034 template <rod B,
class E,
class Style,
class OuterCls>
1036 const char* name =
nullptr) {
1037 constexpr lang L{B::language};
1038 const char* enum_name{
1044 B::template finish_enum<E>(e);
1066 template <rod B,
class T, std::meta::info Decl, auto Bases,
class OuterCls>
1068 const char* cls_name,
const char*
doc) {
1069 constexpr std::meta::info decl{Decl == std::meta::info{} ? ^^T : Decl};
1070 if constexpr (
requires {
1071 B::template make_nested_class<T, decl, Bases>(
1072 m, outer, cls_name,
doc,
1073 std::make_index_sequence<Bases.size()>{});
1075 return B::template make_nested_class<T, decl, Bases>(
1076 m, outer, cls_name,
doc,
1077 std::make_index_sequence<Bases.size()>{});
1078 else if constexpr (
requires {
1079 B::template make_nested_class<T, Bases>(
1080 m, outer, cls_name,
doc,
1081 std::make_index_sequence<Bases.size()>{});
1083 return B::template make_nested_class<T, Bases>(
1084 m, outer, cls_name,
doc,
1085 std::make_index_sequence<Bases.size()>{});
1105 template <rod B,
class E>
1108 if constexpr (
requires { B::template make_enum<E>(m, name, ed); })
1109 return B::template make_enum<E>(m, name, ed);
1111 return B::template make_enum<E>(m, name, ed.
summary);
1125 template <rod B,
class E,
class OuterCls>
1129 if constexpr (
requires { B::template make_nested_enum<E>(m, outer, name, ed); })
1130 return B::template make_nested_enum<E>(m, outer, name, ed);
1131 else if constexpr (
requires {
1132 B::template make_nested_enum<E>(m, outer, name,
1135 return B::template make_nested_enum<E>(m, outer, name, ed.
summary);
1155 template <rod B,
class E,
class Style = naming::none>
1156 static auto bind_enum(
typename B::module_type& m,
const char* name =
nullptr) {
1157 constexpr lang L{B::language};
1158 static_assert(Resolution::participates(^^E, L),
1159 "welder: weld_type<E>: enum E is not welded for this backend's "
1160 "language; annotate it with [[=welder::weld(...)]]");
1162 "welder: weld_type<E>: enum E carries "
1163 "[[=welder::mark::no_reassign]], but that forces a DATA "
1164 "MEMBER's read-only binding — it has no meaning on an enum");
1165 const char* enum_name{
1171 B::template finish_enum<E>(e);
1191 template <rod B,
class T, std::meta::info Decl, auto Bases>
1194 if constexpr (
requires {
1195 B::template make_class<T, Decl, Bases>(
1197 std::make_index_sequence<Bases.size()>{});
1199 return B::template make_class<T, Decl, Bases>(
1200 m, cls_name,
doc, std::make_index_sequence<Bases.size()>{});
1202 return B::template make_class<T, Bases>(
1203 m, cls_name,
doc, std::make_index_sequence<Bases.size()>{});
1238 std::meta::info Decl = std::meta::info{}>
1239 static auto bind_type(
typename B::module_type& m,
const char* name =
nullptr) {
1240 constexpr lang L{B::language};
1242 !std::meta::is_union_type(std::meta::dealias(^^T)),
1243 "welder: unions cannot be welded — C++ has no way to observe which "
1244 "union member is active, so generated member accessors would read "
1245 "inactive members (undefined behavior). Use std::variant instead "
1246 "(converted natively by every rod), or expose the union through "
1247 "safe accessor functions on an enclosing type. To hand-register it "
1248 "with the backend yourself, vouch for the uses via "
1249 "welder::trust_bindable.");
1251 "welder: weld_type<T>: T carries "
1252 "[[=welder::mark::no_reassign]], but that forces a DATA "
1253 "MEMBER's read-only binding — put it on a data member of T, "
1259 static_assert(Decl != std::meta::info{} || Resolution::participates(^^T, L),
1260 "welder: weld_type<T>: T is not welded for this backend's "
1261 "language; annotate it with [[=welder::weld(...)]]");
1262 constexpr auto ctx{std::meta::access_context::unchecked()};
1264 const char* cls_name{
1273 constexpr auto bases{Resolution::template native_bases<^^T, L>()};
1274 auto cls{
make_class_of<B, T, (Decl == std::meta::info{} ? ^^T : Decl),
1293 std::meta::info Decl = std::meta::info{}>
1295 const char* name =
nullptr) {
1296 constexpr lang L{B::language};
1297 static_assert(!std::meta::is_union_type(std::meta::dealias(^^T)),
1298 "welder: unions cannot be welded (see bind_type).");
1299 static_assert(Decl != std::meta::info{} || Resolution::participates(^^T, L),
1300 "welder: predeclare_type<T>: T is not welded for this "
1301 "backend's language.");
1302 const char* cls_name{
1304 constexpr auto bases{Resolution::template native_bases<^^T, L>()};
1307 make_class_of<B, T, (Decl == std::meta::info{} ? ^^T : Decl), bases>(
1318 std::meta::info Decl = std::meta::info{}>
1319 static void fill_type(
typename B::module_type& m,
const char* name =
nullptr) {
1320 constexpr lang L{B::language};
1321 const char* cls_name{
1323 auto cls{B::template reopen_class<T>(m, cls_name)};
1345 template <rod B, std::meta::info Fn,
class Style = naming::none>
1346 static auto bind_function(
typename B::module_type& m,
const char* name =
nullptr) {
1347 constexpr lang L{B::language};
1348 static_assert(std::meta::is_function(Fn),
1349 "welder: weld_function<Fn>: Fn must reflect a (free) function");
1350 static_assert(Resolution::participates(Fn, L),
1351 "welder: weld_function<Fn>: Fn is not welded for this backend's "
1352 "language; annotate it with [[=welder::weld(...)]]");
1354 "welder: weld_function<Fn>: Fn carries a getter/setter "
1355 "mark, but properties are a class surface — the marks "
1356 "apply to member functions only");
1358 "welder: weld_function<Fn>: Fn carries "
1359 "[[=welder::mark::no_reassign]], but that forces a DATA "
1360 "MEMBER's read-only binding — it has no meaning on a function");
1362 template for (
constexpr auto member : std::define_static_array(grp)) {
1367 return B::template add_function<grp, Style>(m, name);
1385 template <rod B, std::meta::info Var,
class Style = naming::none>
1386 static auto bind_variable(
typename B::module_type& m,
const char* name =
nullptr) {
1387 constexpr lang L{B::language};
1388 static_assert(std::meta::is_variable(Var),
1389 "welder: weld_variable<Var>: Var must reflect a namespace "
1392 "welder: weld_variable<Var>: Var carries "
1393 "[[=welder::mark::no_reassign]], but that forces a DATA "
1394 "MEMBER's read-only binding — it has no meaning on a global "
1396 static_assert(Resolution::participates(Var, L),
1397 "welder: weld_variable<Var>: Var is not welded for this "
1398 "backend's language; annotate it with [[=welder::weld(...)]]");
1400 auto session{B::open_module(m)};
1405 if constexpr (std::is_void_v<decltype(B::template add_variable<Var, Style>(
1406 m, session, name))>) {
1407 B::template add_variable<Var, Style>(m, session, name);
1408 B::close_module(m, session);
1410 auto handle{B::template add_variable<Var, Style>(m, session, name)};
1411 B::close_module(m, session);
1428 template <rod B, std::meta::info Ns,
class Style = naming::none>
1430 static_assert(std::meta::is_namespace(Ns),
1431 "welder: weld_namespace<Ns>: Ns must reflect a namespace");
1432 constexpr lang L{B::language};
1433 constexpr auto ctx{std::meta::access_context::unchecked()};
1438 B::set_module_doc(m, nsdoc);
1443 auto session{B::open_module(m)};
1461 template for (
constexpr auto mem :
1462 std::define_static_array(std::meta::members_of(Ns, ctx))) {
1463 if constexpr (std::meta::is_type_alias(mem) &&
1465 if constexpr (Resolution::alias_participates(mem, L, pol, Ns) &&
1467 std::meta::dealias(mem)))
1470 }
else if constexpr (std::meta::is_type(mem) &&
1471 std::meta::is_class_type(mem)) {
1472 if constexpr (Resolution::member_participates(mem, L, pol, Ns))
1474 }
else if constexpr (std::meta::is_type(mem) &&
1475 std::meta::is_enum_type(mem)) {
1476 if constexpr (Resolution::member_participates(mem, L, pol, Ns))
1477 bind_enum<B,
typename [:mem:], Style>(m,
nullptr);
1482 template for (
constexpr auto mem : std::define_static_array(
1483 std::meta::members_of(Ns, ctx))) {
1484 if constexpr (std::meta::is_type_alias(mem) &&
1487 std::meta::dealias(mem))) {
1488 if constexpr (Resolution::alias_participates(mem, L, pol,
1492 B::template bind_container<typename [:mem:], Style>(
1503 template for (
constexpr auto mem :
1504 std::define_static_array(std::meta::members_of(Ns, ctx))) {
1512 !((std::meta::is_type(mem) || std::meta::is_function(mem) ||
1513 std::meta::is_variable(mem) || std::meta::is_namespace(mem)) &&
1515 "welder: [[=welder::mark::no_reassign]] sits on a namespace-scope "
1516 "entity, but it forces a DATA MEMBER's read-only binding — it has no "
1517 "meaning on a function, type, or global variable");
1520 if constexpr (std::meta::is_type_alias(mem)) {
1527 "welder: only weld / weld_as may be attached to a "
1528 "namespace-scope alias; every other mark belongs on the "
1529 "class template, where it applies to all instantiations");
1530 if constexpr (Resolution::alias_participates(mem, L, pol, Ns)) {
1534 "welder: two aliases in this namespace weld the SAME "
1535 "template specialization — each specialization may be "
1536 "welded under exactly one name");
1538 std::meta::dealias(mem))) {
1548 "welder: this alias welds an STL container "
1549 "(std::vector/std::map/std::unordered_map) for "
1550 "opaque, reference-semantic binding — a Python-rod "
1551 "feature (the Lua rods bind containers by reference "
1552 "structurally, needing no opaque alias). Drop the "
1553 "alias for this backend.");
1571 !((std::meta::is_class_type(std::meta::dealias(mem)) ||
1572 std::meta::is_enum_type(std::meta::dealias(mem))) &&
1574 "welder: a namespace-scope alias to a welded NON-template "
1575 "type would bind the type twice (it already binds under "
1576 "its own name); remove the alias's weld, or rename the "
1577 "type with [[=welder::weld_as(...)]]");
1579 }
else if constexpr (std::meta::is_type(mem) &&
1580 std::meta::is_class_type(mem)) {
1583 if constexpr (Resolution::member_participates(mem, L, pol, Ns)) {
1585 fill_type<B,
typename [:mem:], Style>(m,
nullptr);
1589 }
else if constexpr (std::meta::is_type(mem) && std::meta::is_enum_type(mem)) {
1593 Resolution::member_participates(mem, L, pol, Ns))
1594 bind_enum<B,
typename [:mem:], Style>(m,
nullptr);
1595 }
else if constexpr (std::meta::is_type(mem) &&
1596 std::meta::is_union_type(mem)) {
1604 "welder: a union in this namespace carries "
1605 "[[=welder::weld(...)]], but unions cannot be welded — C++ "
1606 "has no way to observe which union member is active, so "
1607 "generated accessors would read inactive members (undefined "
1608 "behavior). Use std::variant instead (converted natively by "
1609 "every rod), or expose the union through safe accessor "
1610 "functions; hand-register it with the backend yourself via "
1611 "welder::trust_bindable on its uses.");
1612 }
else if constexpr (std::meta::is_function(mem) &&
1613 !std::meta::is_operator_function(mem)) {
1622 "welder: a getter/setter mark sits on a NAMESPACE-SCOPE "
1623 "function, but properties are a class surface — the marks "
1624 "apply to member functions only. Bind the free function as "
1625 "an ordinary module function (drop the mark), or wrap the "
1626 "pair in a class.");
1627 if constexpr (Resolution::member_participates(mem, L, pol, Ns)) {
1634 template for (
constexpr auto member :
1635 std::define_static_array(grp)) {
1639 B::template add_function<grp, Style>(m);
1642 }
else if constexpr (std::meta::is_variable(mem)) {
1643 if constexpr (Resolution::member_participates(mem, L, pol, Ns)) {
1645 B::template add_variable<mem, Style>(m, session);
1647 }
else if constexpr (std::meta::is_namespace(mem)) {
1651 if constexpr (Resolution::namespace_participates(mem, L, pol, Ns)) {
1652 auto sub{B::add_submodule(
1659 B::close_module(m, session);
1671 template <rod B, std::meta::info Ns,
class Style = naming::none>
1673 typename B::module_type& m,
const char* name =
nullptr) {
1674 static_assert(std::meta::is_namespace(Ns),
1675 "welder: weld_namespace_as_submodule<Ns>: Ns must reflect a "
1677 typename B::module_type sub{B::add_submodule(
1697 template <
rod B, std::meta::info Ns,
class Style =
naming::none,
class Pre,
1700 static_assert(std::meta::is_namespace(Ns),
1701 "welder: weld_module<Ns>: Ns must reflect a namespace");
1702 static_assert(std::meta::parent_of(Ns) == ^^::,
1703 "welder: weld_module<Ns>: Ns must be a top-level namespace (its "
1704 "name is meant to be the module name)");
Backend-agnostic selection layer: the reflection predicates and selectors that decide what participat...
Backend-agnostic bindability ("can the target language represent this type?").
The core interface concepts welder's static polymorphism rests on, gathered in one catalogue: the cus...
Does rod B implement the optional bind_container hook (i.e.
The contract a rod (a welder backend, welder::rods::…::rod) must satisfy to plug into the generic dri...
Does rod B opt into the driver's two-phase namespace sweep — register every welded type's NAME,...
The reference-semantic container table: which STL containers welder can bind opaquely* (by reference)...
Language-agnostic documentation layer: read [[=welder::doc(...)]] annotations off reflected entities ...
The stored forms of the annotation vocabulary.
consteval std::vector< property_entry > property_entries(std::meta::info type, lang L)
The resolved properties of type for language L: every participating accessor collected (own + flatten...
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 w...
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 decl...
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 ...
consteval bool namespace_has_bound(std::meta::info ns, lang L)
Whether ns holds anything that would bind, directly or nested.
consteval bool sole_alias_of_target(lang L, policy_kind pol)
Is Alias the only participating alias in Ns welding its specialization?
consteval auto ctor_group()
The participating constructors of Type under policy Pol: every bindable-shape constructor (see is_bin...
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 en...
consteval auto manual_function_group()
The semi-manual (weld_function<Fn>) group: Fn first — the user's named entity resolves the group's ta...
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,...
consteval bool is_method_candidate(std::meta::info f)
The shape of a bindable method: a plain non-private member function.
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?
consteval auto overload_group()
Select's overload set for Fn as a fixed-size, splice-ready static array.
consteval bool copy_ctor_admitted()
Whether the resolution admits Type's copy constructor — the marks half of the copy decision; the carr...
consteval bool default_ctor_admitted()
Whether the resolution admits Type's DEFAULT constructor.
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 part...
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)...
consteval const char * alias_bound_name()
The bound name of the type welded through Alias (a namespace-scope alias to a specialization,...
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 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...
consteval const char * property_bound_name()
The bound name of the property Getter defines, for language L under name style Style: the mark's expl...
consteval void validate_move_ctor_marks()
Reject an include/only mark on a move constructor of Type.
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 bool aggregate_initializable()
Whether to synthesize an aggregate field constructor for T (language L, resolution 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 bi...
consteval auto native_base_types()
The native bases of Type for L as a static array of type reflections.
consteval bool welded_for(std::meta::info type, lang L)
Is type welded for language L — i.e.
consteval void assert_callable_bindable()
Assert a function/method/operator/constructor signature binds, unless trusted.
stitch_welding_carriage carriage
The default carriage — an alias for welder::stitch_welding_carriage.
consteval bool is_accessor_for(std::meta::info member, lang L)
Does member supply either property half for language L — i.e.
consteval void assert_bindable()
Hard error the instant welder would bind an unbindable type.
consteval bool bindable()
Is T bindable to language L under backend B?
consteval detail::doc_spec< N > doc(const char(&s)[N])
Attach a docstring to a namespace, class, function, or function parameter.
policy_kind
How greedily a type's members are reflected for binding.
@ automatic
Reflect every member unless explicitly excluded (default).
consteval bool member_alias_marks_admissible(std::meta::info mem)
May the annotations on member type-alias mem appear there?
carriages::basic_carriage< carriages::marker_resolution > stitch_welding_carriage
The stitch-welding carriage (the default): binds only where welder's weld / policy / marks direct — i...
consteval bool alias_welded_for(std::meta::info mem, lang L)
Is the specialization named by alias mem welded for language L — reading the alias's own weld first,...
lang
The target languages welder ships rods for — but not the whole value space.
ent_kind
The nameable entity kinds welder distinguishes, one per name-style hook — picked by the driver/rod so...
@ class_
a class/struct type → transform_class.
@ enum_
an enum type → transform_enum.
consteval bool protected_welded(std::meta::info type, lang L)
Does type admit its protected members for language L — i.e.
consteval const char * weld_as_of()
The verbatim weld_as name forced on Ent for language L, or nullptr.
consteval void assert_setter_bindable()
Assert a property setter's parameter binds, unless trusted — the write half of the getter/setter mach...
consteval void assert_member_bindable()
Assert the type of a data member / namespace variable binds, unless trusted.
carriages::basic_carriage< carriages::greedy_resolution<> > tack_welding_carriage
The tack-welding carriage: binds an unmarked library greedily — every reflectable type / function / g...
consteval policy_kind policy_of(std::meta::info type)
The reflection policy declared on type, defaulting to automatic.
consteval bool alias_marks_admissible(std::meta::info mem)
May the annotations on alias-declaration mem appear there?
consteval bool member_bound(std::meta::info member, lang L, policy_kind pol)
The core decision a backend asks for each member: does member bind for language L under policy pol?
constexpr const char * name_of_or(const char *override_)
Resolve a bound name with a call-site override: override_ wins verbatim, nullptr falls back to name_o...
consteval bool has_accessor_mark(std::meta::info member)
Does member carry any getter/setter mark at all (any role, any language)?
consteval bool has_no_reassign_mark(std::meta::info entity)
Does entity carry any no_reassign mark at all (any language)?
consteval const char * name_of()
The final bound name of Ent (a K-kind entity) for language L under name style Style.
consteval bool names_template_specialization(std::meta::info mem)
Is mem a namespace-scope alias naming a class-template specialization — the one way an instantiation ...
consteval bool is_reference_container(std::meta::info type)
Is type one of the containers welder can bind by reference (opaquely)?
consteval const char * doc_of()
The doc text on Ent (a class, namespace, function, or parameter), or nullptr.
consteval bool is_nested_type(std::meta::info type)
Is type declared at class scope — a nested (member) type?
consteval void assert_operands_bindable()
Assert the operand types of an operator<=> overload bind, unless the overload is trusted — the compar...
consteval std::vector< std::meta::info > public_bases(std::meta::info type)
The types of the public base classes of type.
Language-agnostic name styling: reshape a C++ identifier into a target language's naming convention,...
Language-agnostic resolution: given a reflected type/member and a target language,...
A carriage: welder's reflection-driven traversal, parameterized on a Resolution (which markers it obe...
static auto bind_function(typename B::module_type &m, const char *name=nullptr)
Register free function Fn — with its participating overload siblings — as a module-level function of ...
static B::module_type bind_namespace_as_submodule(typename B::module_type &m, const char *name=nullptr)
Define a submodule of m and bind namespace Ns into it.
static void bind_nested_types(typename B::module_type &m, Cls &cls)
Register the participating member types of Outer onto its class handle cls — the nested-class / neste...
static void fill_type(typename B::module_type &m, const char *name=nullptr)
Phase 3 of the two-phase sweep: RETRIEVE T's predeclared handle (via the rod's reopen_class) and fill...
static void bind_members(Cls &cls)
Flatten the eligible data members, methods and operators of Src onto the class handle cls (a handle f...
static void predeclare_type(typename B::module_type &m, const char *name=nullptr)
Phase 1 of the two-phase sweep: register T's NAME only (create the class handle via make_class_of,...
static auto bind_type(typename B::module_type &m, const char *name=nullptr)
Reflect over T and register it via rod B onto module m.
static void bind_class_interior(typename B::module_type &m, Cls &cls)
Everything a class binding contains beyond the class handle itself — shared by bind_type (a module-sc...
static void bind_nested_enum(typename B::module_type &m, OuterCls &outer, const char *name=nullptr)
static auto make_enum_of(typename B::module_type &m, const char *name, const welder::detail::enum_doc &ed)
Create the module-scope enum handle for E, folding its enumerator docs into the class docstring where...
static std::vector< welder::detail::enumerator_doc > collect_enum_docs()
Gather the documented, participating enumerators of E as welder::detail::enumerator_doc entries,...
static void bind_namespace(typename B::module_type &m)
Reflect over a whole namespace Ns and expose its members on module m.
static auto make_nested_enum_of(typename B::module_type &m, OuterCls &outer, const char *name, const welder::detail::enum_doc &ed)
make_nested_class_of's enum counterpart: the rod's make_nested_enum when present, else the module-sco...
static auto bind_enum(typename B::module_type &m, const char *name=nullptr)
Reflect over enum E and register it via rod B onto module m.
static void bind_operators(Cls &cls)
Emit T's operators: member ones (own + flattened bases') and the anchored free operators** of T's enc...
static auto make_class_of(typename B::module_type &m, const char *cls_name, const char *doc)
Call the rod's class-creation primitive, preferring the extended declaring-entity-aware form when the...
static void bind_properties(Cls &cls)
Emit T's method-backed properties: every accessor-marked member function (own + flattened bases',...
static auto bind_variable(typename B::module_type &m, const char *name=nullptr)
Register a single namespace variable Var as an attribute of m.
static void build_module(typename B::module_type &m, Pre pre, Post post)
Fill an existing module out of top-level namespace Ns: pre hook, bind the namespace,...
static void bind_nested_type(typename B::module_type &m, OuterCls &outer, const char *name=nullptr)
Register nested class T onto the class handle of its enclosing type — bind_type's class-scope sibling...
static auto make_nested_class_of(typename B::module_type &m, OuterCls &outer, const char *cls_name, const char *doc)
static void emit_enumerators(EnumHandle &e)
The per-enumerator walk shared by bind_enum and bind_nested_enum: each enumerator resolves like a dat...
Tack-welding resolution: bind an unmarked library greedily.
static consteval bool alias_participates(std::meta::info mem, lang L, policy_kind pol, std::meta::info)
Greedy: an alias-declared specialization binds like any other type — no weld needed on alias or templ...
static consteval bool protected_participates(std::meta::info mem, lang L, std::meta::info)
Protected members: the WeldProtected knob (the whole-pass blanket for an unannotatable third-party li...
static consteval bool is_native_base(std::meta::info, lang, std::meta::info)
static consteval auto native_bases()
static consteval bool counts_as_registered(std::meta::info type, lang L)
The gate's registration oracle: a type the greedy pass itself registers — any complete class/enum who...
static consteval bool namespace_participates(std::meta::info ns, lang L, policy_kind pol, std::meta::info)
static consteval bool class_member_participates(std::meta::info mem, lang L, policy_kind pol, std::meta::info)
Same as stitch: greedy ignores the weld marker, not the marks — a mark on an individual overload/cons...
static consteval bool member_participates(std::meta::info mem, lang L, policy_kind pol, std::meta::info)
static consteval bool participates(std::meta::info, lang)
Stitch-welding resolution: bind only where welder's markers say to.
static consteval bool counts_as_registered(std::meta::info type, lang L)
The gate's registration oracle: welded ⇒ registered (the welder::welded_registration rule),...
static consteval bool class_member_participates(std::meta::info mem, lang L, policy_kind pol, std::meta::info)
A class member (field / method / operator / constructor — and, loosely, an enumerator) participates: ...
static consteval bool participates(std::meta::info entity, lang L)
A type/function/variable participates iff welded for L.
static consteval bool is_native_base(std::meta::info base, lang L, std::meta::info)
A base is a separately-registered native base iff the user welded it.
static consteval auto native_bases()
T's native (welded) base list, for the class handle.
static consteval bool alias_participates(std::meta::info mem, lang L, policy_kind pol, std::meta::info)
A namespace-scope alias to a class-template specialization participates: welded via the alias's own w...
static consteval bool namespace_participates(std::meta::info ns, lang L, policy_kind pol, std::meta::info)
A nested namespace participates (recurse + submodule).
static consteval bool member_participates(std::meta::info mem, lang L, policy_kind pol, std::meta::info)
A namespace member (class/enum/function/variable) participates.
static consteval bool protected_participates(std::meta::info mem, lang L, std::meta::info)
A protected member is admitted iff its declaring class says so — a policy::weld_protected annotation ...
The raw documentation pieces of an enum, handed to a style to assemble.
const char * summary
The enum's own doc.
The scope-aware registration oracle: Resolution widened with the member-alias registrations of one cl...
static consteval bool counts_as_registered(std::meta::info type, lang L)
The identity style: bind every C++ identifier unchanged.