welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::rods::lua Namespace Reference

Functions

consteval const char * lua_metamethod_name (std::meta::info f)
 Map an operator (member or anchored free) to its Lua metamethod __name, or nullptr if welder does not expose it (which also gates operator eligibility in the driver).

Function Documentation

◆ lua_metamethod_name()

const char * welder::rods::lua::lua_metamethod_name ( std::meta::info f)
consteval

Map an operator (member or anchored free) to its Lua metamethod __name, or nullptr if welder does not expose it (which also gates operator eligibility in the driver).

Unary vs binary is told apart by arity (welder::detail::is_unary_operator — a member operator's left operand is implicit, a free one spells both out), disambiguating the operators with both forms (+, -, *, &, ~). In-place compound assignments (operator+=, …), &&, ||, ++, -- and = are not mapped (same as the Python rods); operator<=> never binds under a slot of its own — it synthesizes __lt/__le instead (see the rods' add_comparisons).

Parameters
fa reflection of the operator function.
Returns
the metamethod __name, or nullptr when not exposed.

Definition at line 53 of file metamethods.hpp.

References welder::detail::is_unary_operator().

Referenced by welder::rods::sol2::operator_mm().