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

Classes

struct  metamethod
 A member operator's sol2 metamethod, or {…, nullptr} if welder does not expose it. More...
struct  rod
 The sol2 rod: a stateless policy type satisfying welder::rod. More...

Typedefs

template<class T, class... A>
using ctor_sig = T(A...)
 The alias T(A...) — a constructor call signature, built by substitute (a namespace-scope alias so it can be reflected as ^^ctor_sig).

Functions

consteval metamethod operator_mm (std::meta::info f)
 Map a member operator to its sol2 metamethod ({…, nullptr} = not exposed).

Typedef Documentation

◆ ctor_sig

template<class T, class... A>
using welder::rods::sol2::ctor_sig = T(A...)

The alias T(A...) — a constructor call signature, built by substitute (a namespace-scope alias so it can be reflected as ^^ctor_sig).

Definition at line 90 of file rod.hpp.

Function Documentation

◆ operator_mm()

metamethod welder::rods::sol2::operator_mm ( std::meta::info f)
consteval

Map a member operator to its sol2 metamethod ({…, nullptr} = not exposed).

The __name and which operators are exposed come from the shared welder::rods::lua::lua_metamethod_name (the same set the LuaBridge3 rod uses); this only adds the sol2 sol::meta_function slot for each. nullptr name ⇒ not exposed (also gates operator eligibility in the driver). Unary vs binary is told apart by arity, disambiguating the operators with both forms (+, -, *, &, ~).

Parameters
fa reflection of the operator function.
Returns
the sol::meta_function and its __name, or a nullptr name.

Definition at line 45 of file metamethods.hpp.

References welder::detail::is_unary_operator(), and welder::rods::lua::lua_metamethod_name().

Referenced by welder::rods::sol2::rod::_register_operator(), and welder::rods::sol2::rod::special_method_name().