18namespace welder::inline v0 {
29 return mask == 0 || (mask &
lang_bit(L)) != 0;
42 return !anns.empty() &&
58 return std::meta::is_type_alias(mem) &&
59 std::meta::is_class_type(std::meta::dealias(mem)) &&
60 std::meta::has_template_arguments(std::meta::dealias(mem));
78 std::meta::extract<detail::weld_spec>(own[0]).mask, L);
93 for (
auto a : std::meta::annotations_of(mem)) {
94 auto t{std::meta::type_of(a)};
101 if (std::meta::has_template_arguments(t)) {
102 auto tmpl{std::meta::template_of(t)};
125 for (
auto a : std::meta::annotations_of(mem)) {
126 auto t{std::meta::type_of(a)};
133 if (std::meta::has_template_arguments(t)) {
134 auto tmpl{std::meta::template_of(t)};
151 : std::meta::extract<detail::policy_spec>(anns[0]).kind;
172 for (
auto a : std::meta::annotations_of_with_type(
174 auto s{std::meta::extract<detail::weld_protected_spec>(a)};
175 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
190 auto s{std::meta::extract<detail::exclude_spec>(a)};
191 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
206 auto s{std::meta::extract<detail::include_spec>(a)};
207 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
226 auto s{std::meta::extract<detail::trust_bindable_spec>(a)};
227 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
245 auto s{std::meta::extract<detail::no_reassign_spec>(a)};
246 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
278 auto s{std::meta::extract<detail::accessor_spec>(a)};
279 if (s.role == role && (s.mask == 0 || (s.mask &
lang_bit(L)) != 0))
317 auto s{std::meta::extract<detail::accessor_spec>(a)};
318 if (s.role == role && (s.mask == 0 || (s.mask &
lang_bit(L)) != 0) &&
320 return std::string{s.name};
339 auto s{std::meta::extract<detail::return_policy_spec>(a)};
340 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
360template <std::meta::info Fn, lang L>
364 constexpr std::meta::info rt{std::meta::return_type_of(Fn)};
365 if constexpr (!(std::meta::is_pointer_type(rt) ||
366 std::meta::is_lvalue_reference_type(rt) ||
367 std::meta::is_rvalue_reference_type(rt)))
391 if (!onlys.empty()) {
393 for (
auto a : onlys) {
394 auto s{std::meta::extract<detail::only_spec>(a)};
418consteval std::vector<std::meta::info>
public_bases(std::meta::info type) {
419 std::vector<std::meta::info> out;
420 constexpr auto ctx{std::meta::access_context::unchecked()};
421 for (
auto b : std::meta::bases_of(type, ctx))
422 if (std::meta::is_public(b))
423 out.push_back(std::meta::type_of(b));
welder's consteval diagnostics, collected in one place: every hand-rolled compile-time error the libr...
consteval bool welded_for(std::meta::info type, lang L)
Is type welded for language L — i.e.
consteval bool is_accessor_for(std::meta::info member, lang L)
Does member supply either property half for language L — i.e.
consteval bool accessor_marked(std::meta::info member, accessor_role role, lang L)
Does member carry a getter/setter mark of role covering L?
consteval bool member_no_reassign(std::meta::info member, lang L)
Is data member member bound read-only for L by a no_reassign mark?
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?
consteval bool trusted_for(std::meta::info member, lang L)
Does member carry a trust_bindable mark covering language L?
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.
rv_kind
How a bound callable's returned object is owned/converted in the target language — welder's backend-n...
@ automatic
The rod default — emit no explicit policy.
@ reference_internal
A non-owning reference tied to the parent's lifetime (implies keep_alive).
@ reference
A non-owning reference; the caller keeps the C++ object alive.
consteval bool excluded_for(std::meta::info member, lang L)
Does member carry an exclude mark covering language L?
consteval bool protected_welded(std::meta::info type, lang L)
Does type admit its protected members for language L — i.e.
consteval void validate_return_policy()
Reject a return_policy on Fn (for language L) that contradicts Fn's return type.
consteval unsigned lang_bit(lang l)
The single-language bit for l within a language mask.
accessor_role
Which half of a property a marked accessor function supplies.
@ getter
The function reads the property's value (const, no parameters).
@ setter
The function writes it (exactly one parameter).
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?
consteval bool included_for(std::meta::info member, lang L)
Does member carry an include mark covering language L?
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 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 std::string accessor_explicit_name(std::meta::info member, accessor_role role, lang L)
The explicit property name an accessor mark of role forces for L, or "" when the name derives from th...
consteval bool weld_mask_admits(unsigned mask, lang L)
Does a weld mask admit language L?
consteval std::vector< std::meta::info > public_bases(std::meta::info type)
The types of the public base classes of type.
consteval rv_kind return_policy_of(std::meta::info fn, lang L)
The return-value policy declared on callable fn for language L.
The stored form of a getter / setter mark: which property half the function supplies,...
The stored form of a doc annotation: a summary docstring.
The stored form of an exclude mark: the languages a member is hidden from.
The stored form of an include mark: the languages a member is opted into.
The stored form of a keep_alive annotation: a lifetime dependency between two of a call's entities,...
The stored form of a no_reassign mark: the languages a data member is bound read-only** for,...
The stored form of an only mark: the complete set of languages a member may bind for — implicitly,...
The stored form of a policy annotation.
The stored form of a returns annotation: a function's return-value doc.
The stored form of a return_policy annotation: a return-value policy, optionally scoped to some langu...
The stored form of a tparam annotation: one template parameter's doc.
The stored form of a trust_bindable member mark.
The stored form of a policy::weld_protected annotation: the languages a type's protected members are ...
The stored form of a weld annotation: the mask of target languages.
Thrown by member_bound (<welder/reflect.hpp>) when a member carries a bare [[=welder::mark::only]] — ...
Thrown by validate_return_policy (<welder/reflect.hpp>) — every rod runs it at its per-overload bind ...