We can avoid unused variable issues entirely and keep MSVC from borking out by explicitly declaring the size of the swallow declaration. This should make all compilers happy.

This commit is contained in:
ThePhD 2013-12-13 23:26:59 -05:00
parent 009a79606a
commit c6f6203ab2

View File

@ -208,8 +208,8 @@ inline int push_user(lua_State* L, T& item) {
namespace detail {
template<typename T, std::size_t... I>
inline void push(lua_State* L, indices<I...>, const T& tuplen) {
using swallow = char[];
void(swallow{'\0', (sol::stack::push(L, std::get<I>(tuplen)), '\0')... });
using swallow = char[ 1 + sizeof...(I) ];
swallow {'\0', (sol::stack::push(L, std::get<I>(tuplen)), '\0')... };
}
template<typename F, typename... Vs>