18namespace welder::inline v0 {
28static_assert(
sizeof(unsigned) >= 4,
29 "welder's language mask needs a >= 32-bit unsigned");
42 if (
static_cast<unsigned>(l) >= 8 *
sizeof(
unsigned))
44 return 1u <<
static_cast<unsigned>(l);
137 template <
class... Ls>
161 template <
class... Ls>
179 template <
class... Ls>
210 template <
class... Ls>
239 template <
class... Ls>
256template <
size_type N>
270template <
size_type N>
283template <
size_type N>
308template <
size_type N,
size_type M>
335template <
size_type N>
388template <
class... Ls>
453template <
size_type N>
466template <
size_type N>
481template <
size_type N,
size_type M>
499template <
size_type N>
516template <
size_type N>
518template <
class... Rest>
525template <
size_type N>
527template <
class... Rest>
548template <
class... Args>
583template <
class... Rest>
591template <
class... Rest>
614template <
class... Args>
welder's consteval diagnostics, collected in one place: every hand-rolled compile-time error the libr...
Target-language vocabulary — the set of languages welder can bind to.
The stored forms of the annotation vocabulary.
consteval unsigned weld_as_mask()
The language mask of a weld_as argument list: the OR of its leading lang markers (the trailing name c...
consteval unsigned return_policy_mask(rv_kind)
The language mask of a return_policy argument list: the OR of its leading lang markers (the trailing ...
consteval fixed_string< N > weld_as_name(const char(&s)[N])
The verbatim name of a weld_as argument list: the trailing string, reached by dropping the leading la...
consteval rv_kind return_policy_kind(rv_kind k)
The policy of a return_policy argument list: the trailing kind, reached by dropping the leading lang ...
The bare mark annotation objects — use directly or call to scope by language.
constexpr detail::trust_bindable_spec trust_bindable
constexpr detail::only_spec only
constexpr detail::exclude_spec exclude
constexpr detail::include_spec include
The policy annotation values.
constexpr detail::weld_protected_spec weld_protected
Admit the type's protected members into resolution — bare (all languages) or called with languages to...
constexpr detail::policy_spec opt_in
constexpr detail::policy_spec automatic
The return-value policy values, the user-facing spelling of rv_kind.
constexpr rv_kind reference
constexpr rv_kind reference_internal
constexpr rv_kind automatic_reference
constexpr rv_kind automatic
constexpr rv_kind take_ownership
consteval detail::weld_spec weld(Ls... ls)
Build a weld annotation naming the target languages.
consteval detail::return_doc_spec< N > returns(const char(&s)[N])
Document a function's return value.
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).
@ opt_in
Reflect only members explicitly marked include.
consteval detail::weld_as_spec< N > weld_as(const char(&s)[N])
Force s as the target name in every welded language.
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...
@ copy
Copy the returned object into a target-owned value.
@ automatic_reference
Like automatic but never take ownership (used for arguments).
@ automatic
The rod default — emit no explicit policy.
@ none
Do not convert (nanobind rv_policy::none); pybind11 has no equivalent.
@ move
Move the returned object into a target-owned value.
@ take_ownership
The target owns the returned pointer and frees it.
@ 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 detail::tparam_spec< N, M > tparam(const char(&name)[N], const char(&text)[M])
Document a template parameter (repeatable, ordered).
consteval unsigned lang_mask(Ls... ls)
The mask naming the languages ls.
consteval detail::return_policy_spec return_policy(Args... args)
Force a return-value policy on a callable, optionally scoped to one or more languages.
constexpr bool trust_bindable
The type-level trust customization point: specialize to true to trust T wherever it appears (member,...
consteval unsigned lang_bit(lang l)
The single-language bit for l within a language mask.
consteval detail::keep_alive_spec keep_alive(unsigned nurse, unsigned patient)
Keep the call entity patient alive at least until nurse is collected.
decltype(sizeof(0)) size_type
std::size_t named without a standard-library include, keeping this vocabulary header std-free (see th...
The stored form of a doc annotation: a summary docstring.
fixed_string< N > text
The docstring text.
The stored form of an exclude mark: the languages a member is hidden from.
unsigned mask
The languages to exclude from; 0 == all languages.
consteval exclude_spec operator()(Ls... ls) const
Scope the exclusion to specific languages.
A string literal captured by value, length included, so it can live in a structural annotation consta...
consteval fixed_string(const char(&s)[N])
Capture the characters of s.
char data[N]
The captured characters, including the terminator.
The stored form of an include mark: the languages a member is opted into.
consteval include_spec operator()(Ls... ls) const
Scope the inclusion to specific languages.
unsigned mask
The languages to include for; 0 == all languages.
The stored form of a keep_alive annotation: a lifetime dependency between two of a call's entities,...
unsigned patient
The dependant kept alive until the nurse is collected (e.g.
unsigned nurse
The keeper whose collection bounds the dependency (e.g.
The stored form of an only mark: the complete set of languages a member may bind for — implicitly,...
unsigned mask
The only languages to bind for; 0 == the (diagnosed) bare form.
consteval only_spec operator()(lang first, Ls... rest) const
Name the complete set of languages the member may bind for.
The stored form of a policy annotation.
policy_kind kind
The chosen policy.
The stored form of a returns annotation: a function's return-value doc.
fixed_string< N > text
The return-value documentation.
The stored form of a return_policy annotation: a return-value policy, optionally scoped to some langu...
unsigned mask
The languages to apply to; 0 == all languages.
rv_kind kind
The chosen policy.
The stored form of a tparam annotation: one template parameter's doc.
fixed_string< N > name
The documented template parameter's name.
fixed_string< M > text
Its documentation.
The stored form of a trust_bindable member mark.
unsigned mask
The languages to trust for; 0 == all languages.
consteval trust_bindable_spec operator()(Ls... ls) const
Scope the vouch to specific languages.
The stored form of a weld_as annotation: a forced target-language name.
unsigned mask
The languages to rename for; 0 == all languages.
fixed_string< N > name
The verbatim target-language name.
The stored form of a policy::weld_protected annotation: the languages a type's protected members are ...
consteval weld_protected_spec operator()(Ls... ls) const
Scope the admission to specific languages.
unsigned mask
The languages to admit protected members for; 0 == all.
The stored form of a weld annotation: the mask of target languages.
unsigned mask
The languages this entity is welded for.
Thrown by lang_bit (<welder/annotations.hpp>) when a lang value lies past the 32-bit language-mask wi...