- Timestamp:
- 06/12/14 15:38:09 (11 years ago)
- Location:
- trunk/nv
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/lua/lua_dispatch.hh
r213 r253 138 138 }; 139 139 140 template < typename F, F *f >140 template < typename F, F f > 141 141 int function_wrapper( lua_State* L ) 142 142 { … … 144 144 } 145 145 146 template < typename C, typename F, F *f >146 template < typename C, typename F, F f > 147 147 int object_method_wrapper( lua_State* L ) 148 148 { 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 ); 151 151 } 152 152 153 template < typename C, typename F, F *f >153 template < typename C, typename F, F f > 154 154 int fixed_method_wrapper( lua_State* L ) 155 155 { 156 156 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 ); 158 158 } 159 159 -
trunk/nv/lua/lua_function.hh
r198 r253 12 12 #include <nv/lua/lua_values.hh> 13 13 #include <nv/lua/lua_path.hh> 14 15 struct lua_State;16 14 17 15 namespace nv -
trunk/nv/lua/lua_state.hh
r228 r253 136 136 bool is_defined( const path& p ) { return is_defined( p, m_global ); } 137 137 void register_native_function( lfunction f, const char* name ); 138 template < typename F, F* f > 138 139 template < typename F, F f > 139 140 void register_function( const char* name ) 140 141 { … … 142 143 } 143 144 144 template < typename C, typename F, F * f >145 template < typename C, typename F, F f > 145 146 void register_function( const char* name ) 146 147 { … … 212 213 void unregister_object( object * o ); 213 214 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 > 215 216 void register_object_method( const char* lua_name, const char* name ) 216 217 { -
trunk/nv/type_traits.hh
r214 r253 163 163 164 164 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 }; 170 169 171 170 template < typename T >
Note: See TracChangeset
for help on using the changeset viewer.