welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::detail::weld_spec Struct Reference

The stored form of a weld annotation: the mask of target languages. More...

#include <welder/annotations.hpp>

Public Member Functions

template<class... Ls>
consteval weld_spec operator() (Ls... ls) const
 Scope the weld to specific languages.

Public Attributes

unsigned mask = 0
 The languages this entity is welded for; 0 == all.

Detailed Description

The stored form of a weld annotation: the mask of target languages.

Usable bare (every language welder binds) or called with languages to scope it, like exclude_spec and weld_protected_spec:

struct [[=welder::weld]] A { ... }; // every language
struct [[=welder::weld(welder::lang::py)]] B { ... }; // Python only
constexpr detail::weld_spec weld
The weld annotation: declare an entity bound, and for which languages.
@ py
Python (via the pybind11 and nanobind backends).
Definition lang.hpp:43

The bare form is the language-agnostic spelling a project reaches for when it wants a type to appear in whatever rods it builds — adding a backend later (a C# module beside a Python one) then needs no annotation churn. Scope it only where a type genuinely belongs to one language's surface.

Definition at line 125 of file annotations.hpp.

Member Function Documentation

◆ operator()()

template<class... Ls>
weld_spec welder::detail::weld_spec::operator() ( Ls... ls) const
inlineconsteval

Scope the weld to specific languages.

Template Parameters
Lsthe language enum types (deduced).
Parameters
lsthe target languages this entity is exposed to.
Returns
a scoped weld_spec.

Definition at line 133 of file annotations.hpp.

References welder::lang_mask().

Member Data Documentation

◆ mask

unsigned welder::detail::weld_spec::mask = 0

The languages this entity is welded for; 0 == all.

Definition at line 126 of file annotations.hpp.


The documentation for this struct was generated from the following file: