mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Cast result of floating point retrieval before receiving it
This commit is contained in:
parent
c59fc9e536
commit
a6306d7012
|
@ -45,7 +45,7 @@ inline T get_unsigned(lua_State* L, std::false_type, int index = -1) {
|
|||
template<typename T>
|
||||
inline T get_arithmetic(lua_State* L, std::false_type, int index = -1) {
|
||||
// T is a floating point
|
||||
return lua_tonumber(L, index);
|
||||
return static_cast<T>(lua_tonumber(L, index));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Reference in New Issue
Block a user