|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
The annotation vocabulary users attach to their types — weld, policy, mark, doc, returns, tparam. More...
Go to the source code of this file.
Classes | |
| struct | welder::detail::weld_spec |
| The stored form of a weld annotation: the mask of target languages. More... | |
| struct | welder::detail::policy_spec |
| The stored form of a policy annotation. More... | |
| struct | welder::detail::weld_protected_spec |
| The stored form of a policy::weld_protected annotation: the languages a type's protected members are admitted for. More... | |
| struct | welder::detail::exclude_spec |
| The stored form of an exclude mark: the languages a member is hidden from. More... | |
| struct | welder::detail::include_spec |
| The stored form of an include mark: the languages a member is opted into. More... | |
| struct | welder::detail::only_spec |
| The stored form of an only mark: the complete set of languages a member may bind for — implicitly, not for any other. More... | |
| struct | welder::detail::trust_bindable_spec |
| The stored form of a trust_bindable member mark. More... | |
| struct | welder::detail::fixed_string< N > |
| A string literal captured by value, length included, so it can live in a structural annotation constant. More... | |
| struct | welder::detail::doc_spec< N > |
| The stored form of a doc annotation: a summary docstring. More... | |
| struct | welder::detail::return_doc_spec< N > |
| The stored form of a returns annotation: a function's return-value doc. More... | |
| struct | welder::detail::tparam_spec< N, M > |
| The stored form of a tparam annotation: one template parameter's doc. More... | |
| struct | welder::detail::weld_as_spec< N > |
| The stored form of a weld_as annotation: a forced target-language name. More... | |
| struct | welder::detail::return_policy_spec |
| The stored form of a return_policy annotation: a return-value policy, optionally scoped to some languages. More... | |
| struct | welder::detail::keep_alive_spec |
| The stored form of a keep_alive annotation: a lifetime dependency between two of a call's entities, addressed by pybind11/nanobind's index convention (0 = the return value, 1 = the first argument — the implicit this for a method — 2 = the second, …). More... | |
Namespaces | |
| namespace | welder |
| namespace | welder::detail |
| The stored forms of the annotation vocabulary. | |
| namespace | welder::policy |
| The policy annotation values. | |
| namespace | welder::mark |
| The bare mark annotation objects — use directly or call to scope by language. | |
| namespace | welder::rv |
| The return-value policy values, the user-facing spelling of rv_kind. | |
Typedefs | |
| using | welder::size_type = decltype(sizeof(0)) |
| std::size_t named without a standard-library include, keeping this vocabulary header std-free (see the file note). | |
Enumerations | |
| enum class | welder::policy_kind : unsigned char { welder::automatic , welder::opt_in } |
| How greedily a type's members are reflected for binding. More... | |
| enum class | welder::rv_kind : unsigned char { welder::automatic , welder::automatic_reference , welder::take_ownership , welder::copy , welder::move , welder::reference , welder::reference_internal , welder::none } |
| How a bound callable's returned object is owned/converted in the target language — welder's backend-neutral spelling of the return-value policy. More... | |
Functions | |
| consteval unsigned | welder::lang_bit (lang l) |
| The single-language bit for l within a language mask. | |
| template<class... Ls> | |
| consteval unsigned | welder::lang_mask (Ls... ls) |
| The mask naming the languages ls. | |
| template<class... Ls> | |
| consteval detail::weld_spec | welder::weld (Ls... ls) |
| Build a weld annotation naming the target languages. | |
| template<size_type N> | |
| consteval detail::doc_spec< N > | welder::doc (const char(&s)[N]) |
| Attach a docstring to a namespace, class, function, or function parameter. | |
| template<size_type N> | |
| consteval detail::return_doc_spec< N > | welder::returns (const char(&s)[N]) |
| Document a function's return value. | |
| template<size_type N, size_type M> | |
| consteval detail::tparam_spec< N, M > | welder::tparam (const char(&name)[N], const char(&text)[M]) |
| Document a template parameter (repeatable, ordered). | |
| template<size_type N> | |
| consteval detail::weld_as_spec< N > | welder::weld_as (const char(&s)[N]) |
| Force s as the target name in every welded language. | |
| consteval unsigned | welder::detail::weld_as_mask () |
| The language mask of a weld_as argument list: the OR of its leading lang markers (the trailing name contributes nothing; no markers → 0 = all). | |
| template<size_type N> | |
| consteval unsigned | welder::detail::weld_as_mask (const char(&)[N]) |
| template<class... Rest> | |
| consteval unsigned | welder::detail::weld_as_mask (lang l, Rest &&... rest) |
| template<size_type N> | |
| consteval fixed_string< N > | welder::detail::weld_as_name (const char(&s)[N]) |
| The verbatim name of a weld_as argument list: the trailing string, reached by dropping the leading lang markers (its extent N preserved by reference). | |
| template<class... Rest> | |
| consteval auto | welder::detail::weld_as_name (lang, Rest &&... rest) |
| template<class... Args> | |
| consteval auto | welder::weld_as (Args &&... args) |
| Force a verbatim target name, optionally scoped to one or more languages. | |
| consteval unsigned | welder::detail::return_policy_mask (rv_kind) |
| The language mask of a return_policy argument list: the OR of its leading lang markers (the trailing kind contributes nothing; no markers → 0 = all). | |
| template<class... Rest> | |
| consteval unsigned | welder::detail::return_policy_mask (lang l, Rest... rest) |
| consteval rv_kind | welder::detail::return_policy_kind (rv_kind k) |
| The policy of a return_policy argument list: the trailing kind, reached by dropping the leading lang markers. | |
| template<class... Rest> | |
| consteval rv_kind | welder::detail::return_policy_kind (lang, Rest... rest) |
| template<class... Args> | |
| consteval detail::return_policy_spec | welder::return_policy (Args... args) |
| Force a return-value policy on a callable, optionally scoped to one or more languages. | |
| consteval detail::keep_alive_spec | welder::keep_alive (unsigned nurse, unsigned patient) |
| Keep the call entity patient alive at least until nurse is collected. | |
The annotation vocabulary users attach to their types — weld, policy, mark, doc, returns, tparam.
Users spell these through the factory functions and the policy / mark objects below; the stored forms each one produces (the *_spec structs the reflection layer reads back) are implementation detail, tucked into welder::detail so they don't crowd the public welder:: namespace.
Like <welder/lang.hpp>, this header is kept std-include-free so a future welder C++20 module can re-export it without leaking std into importers.
Definition in file annotations.hpp.