Changeset 253 for trunk


Ignore:
Timestamp:
06/12/14 15:38:09 (11 years ago)
Author:
epyon
Message:
  • managed finally to force the compile-time, hand-written performance, Lua function binding to work
  • FUCK YEAH!
Location:
trunk/nv
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/lua/lua_dispatch.hh

    r213 r253  
    138138                        };
    139139
    140                         template < typename F, F* f >
     140                        template < typename F, F f >
    141141                        int function_wrapper( lua_State* L )
    142142                        {
     
    144144                        }
    145145
    146                         template < typename C, typename F, F* f >
     146                        template < typename C, typename F, F f >
    147147                        int object_method_wrapper( lua_State* L )
    148148                        {
    149                                 C* c = to_object( L, 1 );
    150                                 return dispatcher<typename return_type<F>::type>::call( L, c, 2, f );
     149                                C* c = (C*)to_object( L, 1 );
     150                                return dispatcher<typename return_type<F>::type>::call( L, 2, *c, f );
    151151                        }
    152152
    153                         template < typename C, typename F, F* f >
     153                        template < typename C, typename F, F f >
    154154                        int fixed_method_wrapper( lua_State* L )
    155155                        {
    156156                                C* c = (C*)to_pointer( L, nv::lua::detail::upvalue_index(1) );
    157                                 return dispatcher<typename return_type<F>::type>::call( L, c, 1, f );
     157                                return dispatcher<typename return_type<F>::type>::call( L, 1, *c, f );
    158158                        }
    159159                       
  • trunk/nv/lua/lua_function.hh

    r198 r253  
    1212#include <nv/lua/lua_values.hh>
    1313#include <nv/lua/lua_path.hh>
    14 
    15 struct lua_State;
    1614
    1715namespace nv
  • trunk/nv/lua/lua_state.hh

    r228 r253  
    136136                        bool is_defined( const path& p ) { return is_defined( p, m_global ); }
    137137                        void register_native_function( lfunction f, const char* name );
    138                         template < typename F, F* f >
     138
     139                        template < typename F, F f >
    139140                        void register_function( const char* name )
    140141                        {
     
    142143                        }
    143144
    144                         template < typename C, typename F, F* f >
     145                        template < typename C, typename F, F f >
    145146                        void register_function( const char* name )
    146147                        {
     
    212213                        void unregister_object( object * o );
    213214                        void register_native_object_method( const char* lua_name, const char* name, lfunction f );
    214                         template < typename F, F* f >
     215                        template < typename F, F f >
    215216                        void register_object_method( const char* lua_name, const char* name )
    216217                        {
  • trunk/nv/type_traits.hh

    r214 r253  
    163163
    164164        template < typename F >
    165         struct function_traits : public detail::function_traits_impl< typename std::add_pointer< F >::type >
    166         {
    167 
    168         };
    169 
     165        struct function_traits : public detail::function_traits_impl< F >
     166        {
     167
     168        };
    170169
    171170        template < typename T >
Note: See TracChangeset for help on using the changeset viewer.