From ebf4908c27d5561852b41f9da258e60854cc116d Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 1 Dec 2013 18:57:28 -0500 Subject: [PATCH] Formatting corrections --- sol/function.hpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sol/function.hpp b/sol/function.hpp index e0a4f1bf..5aee99b0 100644 --- a/sol/function.hpp +++ b/sol/function.hpp @@ -1,38 +1,38 @@ #ifndef SOL_FUNCTION_HPP #define SOL_FUNCTION_HPP -#include -#include -#include +#include "reference.hpp" +#include "tuple.hpp" +#include "stack.hpp" namespace sol { class function : virtual public reference { private: template - void push_args( Args&&... args ) { - auto L = state( ); + void push_args(Args&&... args) { + auto L = state(); using swallow = char []; - void( swallow{ ( stack::push( L, std::forward( args ) ), '\0' )... } ); + void( swallow{ (stack::push(L, std::forward(args)), '\0')... } ); } public: - function( ) : reference( ) {} - function( lua_State* L, int index = -1 ) : reference( L, index ) { - type_assert( L, index, type::function ); + function() : reference() {} + function(lua_State* L, int index = -1) : reference(L, index) { + type_assert(L, index, type::function); } template - T invoke( Args&&... args ) { - push( ); - push_args( std::forward( args )... ); - lua_pcall( state( ), sizeof...( Args ), 1, 0 ); - return stack::pop( state( ) ); + T invoke(Args&&... args) { + push(); + push_args(std::forward(args)...); + lua_pcall(state(), sizeof...(Args), 1, 0); + return stack::pop(state()); } template - void invoke( Args&&... args ) { - push( ); - push_args( std::forward( args )... ); - lua_pcall( state( ), sizeof...( Args ), 0, 0 ); + void invoke(Args&&... args) { + push(); + push_args(std::forward(args)...); + lua_pcall(state(), sizeof...(Args), 0, 0); } }; } // sol