|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
The C++-operator → Python special-method ("dunder") map shared by welder's Python backends. More...
Go to the source code of this file.
Namespaces | |
| namespace | welder |
| namespace | welder::rods |
| namespace | welder::rods::python |
Functions | |
| consteval const char * | welder::rods::python::operator_dunder (std::meta::info f) |
| The Python special-method ("dunder") name for a member operator, or nullptr if welder does not expose that operator. | |
The C++-operator → Python special-method ("dunder") map shared by welder's Python backends.
pybind11 and nanobind expose the same Python object model, so a member operator maps to the same dunder in both (operator+ → __add__, …). This header holds that one map so neither backend re-derives it — the Python analogue of <welder/rods/lua/metamethods.hpp> and <welder/rods/python/doc_style.hpp>. A backend calls welder::rods::python::operator_dunder from its special_method_name (the map that both gates operator eligibility and names the slot) and its add_operator.
Requires the welder vocabulary first (#include <welder/vocabulary.hpp>), like the rest of the reflection layer.
Definition in file operators.hpp.