@@ -40,14 +40,14 @@ void luaX_add_table_func(lua_State *lua_state, char const *key,
4040
4141template <typename COLLECTION, typename FUNC>
4242void luaX_add_table_array (lua_State *lua_state, char const *key,
43- COLLECTION const &collection, FUNC & &func)
43+ COLLECTION const &collection, FUNC const &func)
4444{
4545 lua_pushstring (lua_state, key);
4646 lua_createtable (lua_state, (int )collection.size (), 0 );
4747 int n = 0 ;
4848 for (auto const &member : collection) {
4949 lua_pushinteger (lua_state, ++n);
50- std::forward<FUNC>( func) (member);
50+ func (member);
5151 lua_rawset (lua_state, -3 );
5252 }
5353 lua_rawset (lua_state, -3 );
@@ -99,15 +99,15 @@ bool luaX_is_array(lua_State *lua_state);
9999 * \post Stack is unchanged.
100100 */
101101template <typename FUNC>
102- void luaX_for_each (lua_State *lua_state, FUNC & &func)
102+ void luaX_for_each (lua_State *lua_state, FUNC const &func)
103103{
104104 assert (lua_istable (lua_state, -1 ));
105105 lua_pushnil (lua_state);
106106 while (lua_next (lua_state, -2 ) != 0 ) {
107107#ifndef NDEBUG
108108 int const top = lua_gettop (lua_state);
109109#endif
110- std::forward<FUNC>( func) ();
110+ func ();
111111 assert (top == lua_gettop (lua_state));
112112 lua_pop (lua_state, 1 );
113113 }
0 commit comments