Another option is to patch tolua++ to output enum range checking code, I think I've found the function responsible for outputting parameter checking code.