Fix crash in clang while casting enums

This commit is contained in:
Eduardo Bart 2012-07-29 09:58:25 -03:00
parent 68ebcb559f
commit e2efbcffbe
1 changed files with 6 additions and 1 deletions

View File

@ -166,7 +166,12 @@ int push_internal_luavalue(T v) {
template<class T>
typename std::enable_if<std::is_enum<T>::value, bool>::type
luavalue_cast(int index, T& myenum) {
return luavalue_cast(index, (int&)myenum);
int i;
if(luavalue_cast(index, i)) {
myenum = (T)i;
return true;
}
return false;
}
template<class T>