mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-20 03:51:18 +00:00
make conversion functions inline
This commit is contained in:
parent
b1a871b9b9
commit
68272383fa
@ -65,7 +65,8 @@ namespace conky {
|
|||||||
struct lua_traits<T, true, false, false> {
|
struct lua_traits<T, true, false, false> {
|
||||||
static const lua::Type type = lua::TNUMBER;
|
static const lua::Type type = lua::TNUMBER;
|
||||||
|
|
||||||
static std::pair<T, bool> convert(lua::state &l, int index, const std::string &)
|
static inline std::pair<T, bool>
|
||||||
|
convert(lua::state &l, int index, const std::string &)
|
||||||
{ return {l.tointeger(index), true}; }
|
{ return {l.tointeger(index), true}; }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -74,7 +75,8 @@ namespace conky {
|
|||||||
struct lua_traits<T, false, true, false> {
|
struct lua_traits<T, false, true, false> {
|
||||||
static const lua::Type type = lua::TNUMBER;
|
static const lua::Type type = lua::TNUMBER;
|
||||||
|
|
||||||
static std::pair<T, bool> convert(lua::state &l, int index, const std::string &)
|
static inline std::pair<T, bool>
|
||||||
|
convert(lua::state &l, int index, const std::string &)
|
||||||
{ return {l.tonumber(index), true}; }
|
{ return {l.tonumber(index), true}; }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -83,7 +85,8 @@ namespace conky {
|
|||||||
struct lua_traits<std::string, false, false, false> {
|
struct lua_traits<std::string, false, false, false> {
|
||||||
static const lua::Type type = lua::TSTRING;
|
static const lua::Type type = lua::TSTRING;
|
||||||
|
|
||||||
static std::pair<std::string, bool> convert(lua::state &l, int index, const std::string &)
|
static inline std::pair<std::string, bool>
|
||||||
|
convert(lua::state &l, int index, const std::string &)
|
||||||
{ return {l.tostring(index), true}; }
|
{ return {l.tostring(index), true}; }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -92,7 +95,8 @@ namespace conky {
|
|||||||
struct lua_traits<bool, true, false, false> {
|
struct lua_traits<bool, true, false, false> {
|
||||||
static const lua::Type type = lua::TBOOLEAN;
|
static const lua::Type type = lua::TBOOLEAN;
|
||||||
|
|
||||||
static std::pair<bool, bool> convert(lua::state &l, int index, const std::string &)
|
static inline std::pair<bool, bool>
|
||||||
|
convert(lua::state &l, int index, const std::string &)
|
||||||
{ return {l.toboolean(index), true}; }
|
{ return {l.toboolean(index), true}; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user