36 static std::optional<T>
get(lua_State *L,
int i) {
37 switch(lua_type(L,
i)) {
50 static bool get(lua_State *L,
int i) {
51 return lua_toboolean(L,
i);
56template<std::convertible_to<const
void> T>
58 static T*
get(lua_State *L,
int i) {
59 return lua_touserdata(L,
i);
69template<detail::
integer T>
71 static T get(lua_State *L,
int i) {
72 return static_cast<T>(lua_tointeger(L,
i));
81template<detail::number T>
83 static T get(lua_State *L,
int i) {
84 return static_cast<T>(lua_tonumber(L,
i));
89template<scoped_enum T>
92 static T get(lua_State *L,
int i) {
100 static const char *
get(lua_State *L,
int i) {
101 return lua_tostring(L,
i);
111 static std::string_view
get(lua_State *L,
int i) {
113 const char *
const s = lua_tolstring(L,
i, &
n);
121 static std::string
get(lua_State *L,
int i) {
129 static lua_CFunction
get(lua_State *L,
int i) {
130 return lua_tocfunction(L,
i);
135template<detail::stack_type T>
150 static T *
get(lua_State *L,
int i) {
161 static T &
get(lua_State *L,
int i) {
171template<
typename ...Ts>
174 static std::tuple<Ts...>
get(lua_State *L,
int i) {
175 constexpr auto n =
static_cast<int>(
sizeof...(Ts));
176 return [L,
i]<
int ...Is>(std::integer_sequence<
int, Is...>) {
178 }(std::make_integer_sequence<int, n>{});
local class const
Definition animation.lua:7
get_type get(void) const
Pointer to the contained/referenced object.
Definition user.h:124
precision highp int
Definition common.h:14
for i
Definition font.lua:5
local n
Definition dump_lights.lua:5
constexpr bool can_get
Whether this library knows how to read a T value from the stack.
Definition lua.h:183
Definition lua_audio.cpp:19
get
Definition camera.lua:46
static T get(lua_State *L, int i)
Definition get.h:71
static T * get(lua_State *L, int i)
Definition get.h:58
static T & get(lua_State *L, int i)
Definition get.h:161
static bool get(lua_State *L, int i)
Definition get.h:50
static const char * get(lua_State *L, int i)
Definition get.h:100
static lua_CFunction get(lua_State *L, int i)
Definition get.h:129
static std::optional< T > get(lua_State *L, int i)
Definition get.h:36
static std::string get(lua_State *L, int i)
Definition get.h:121
static std::string_view get(lua_State *L, int i)
Definition get.h:111
static std::tuple< Ts... > get(lua_State *L, int i)
Definition get.h:174
Reads a value from the Lua stack.
Definition lua.h:118
std::chrono::seconds s
Definition timing.cpp:6
Operations on light/full user data values.