welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
module.hpp
Go to the documentation of this file.
1#pragma once
15#include <welder/module.hpp> // the backend-agnostic WELDER_MODULE dispatch
16
31#define WELDER_DETAIL_MODULE_ENTRY_nanobind(ns, ...) \
32 static void welder_glue_##ns##_nanobind(::nanobind::module_&); \
33 NB_MODULE(ns, welder_module_var_) { \
34 using welder_weld_ = ::welder::detail::module_welder_t< \
35 ::welder::welder<::welder::rods::nanobind::rod<>> \
36 __VA_OPT__(, ) __VA_ARGS__>; \
37 static_assert( \
38 ::std::is_same_v<typename welder_weld_::module_type, \
39 ::nanobind::module_>, \
40 "WELDER_MODULE(ns, nanobind, W): W must be a welder::welder over a " \
41 "rod whose module handle is nanobind::module_"); \
42 welder_weld_::weld_module<^^ns>( \
43 welder_module_var_, welder_weld_::noop, \
44 [](::nanobind::module_& welder_glue_m_) { \
45 welder_glue_##ns##_nanobind(welder_glue_m_); \
46 }); \
47 } \
48 static void welder_glue_##ns##_nanobind(::nanobind::module_& module)
Rod-agnostic module entry point — the WELDER_MODULE macro.
welder nanobind rod (header-only).