17namespace welder::inline v0 {
28 return !anns.empty() &&
29 (std::meta::extract<detail::weld_spec>(anns[0]).mask &
lang_bit(L)) != 0;
44 return std::meta::is_type_alias(mem) &&
45 std::meta::is_class_type(std::meta::dealias(mem)) &&
46 std::meta::has_template_arguments(std::meta::dealias(mem));
63 return (std::meta::extract<detail::weld_spec>(own[0]).mask &
lang_bit(L)) !=
79 for (
auto a : std::meta::annotations_of(mem)) {
80 auto t{std::meta::type_of(a)};
86 if (std::meta::has_template_arguments(t)) {
87 auto tmpl{std::meta::template_of(t)};
110 for (
auto a : std::meta::annotations_of(mem)) {
111 auto t{std::meta::type_of(a)};
117 if (std::meta::has_template_arguments(t)) {
118 auto tmpl{std::meta::template_of(t)};
135 : std::meta::extract<detail::policy_spec>(anns[0]).kind;
156 for (
auto a : std::meta::annotations_of_with_type(
158 auto s{std::meta::extract<detail::weld_protected_spec>(a)};
159 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
174 auto s{std::meta::extract<detail::exclude_spec>(a)};
175 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
190 auto s{std::meta::extract<detail::include_spec>(a)};
191 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
210 auto s{std::meta::extract<detail::trust_bindable_spec>(a)};
211 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
231 auto s{std::meta::extract<detail::return_policy_spec>(a)};
232 if (s.mask == 0 || (s.mask &
lang_bit(L)) != 0)
252template <std::meta::info Fn, lang L>
256 constexpr std::meta::info rt{std::meta::return_type_of(Fn)};
257 if constexpr (!(std::meta::is_pointer_type(rt) ||
258 std::meta::is_lvalue_reference_type(rt) ||
259 std::meta::is_rvalue_reference_type(rt)))
280 if (!onlys.empty()) {
282 for (
auto a : onlys) {
283 auto s{std::meta::extract<detail::only_spec>(a)};
307consteval std::vector<std::meta::info>
public_bases(std::meta::info type) {
308 std::vector<std::meta::info> out;
309 constexpr auto ctx{std::meta::access_context::unchecked()};
310 for (
auto b : std::meta::bases_of(type, ctx))
311 if (std::meta::is_public(b))
312 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.
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.
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 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::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 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 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 ...