Re: [luabind] [SPAM] [Bayesian][testmode] Re: MetroWerks Template/Function Overloading: How do you
Brought to you by:
arvidn,
daniel_wallin
From: Stephan K. <ste...@ya...> - 2007-12-03 01:38:35
|
The is_user_defined overload problem is the same as the get_const_holder overload problem, afaics. We got around it by including our custom overloads *before* including any of the Luabind headers (which would pull in the "is_user_defined(...)" overload). Sorry for not having been clear enough. On Mo, 3.12.2007, 01:14, Peter Suwara wrote: > Hi Stephen, > I am not sure how you got around the is_user_defined overload in the case > you presented here. Was you example a case where you got around the > is_user_defined overload, or another other similar overload issue > regerading > smart_ptr's? > > In any case, I am going to try and include all of the headers before > POLICY.HPP and see if that actually provides the correct overload. > > Cheers, > Peter > > ----- Original Message ----- > From: "Stephan Kaiser" <ste...@ya...> > To: <lua...@li...> > Sent: Saturday, December 01, 2007 2:15 AM > Subject: [SPAM] [Bayesian][testmode] Re: [luabind] MetroWerks > Template/Function Overloading: How do you kick this... > > >> The problem is not limited to Metrowerks and is due to a >> misunderstanding >> of overload resolution. >> >> The problem is also the same for smart_ptr overloads, btw. >> >> A description of the issue can be found in our sources: >> http://yake.svn.sourceforge.net/viewvc/yake/trunk/yake/src/bindings.lua/detail/task.lua.cpp?view=markup >> at line 30 >> >> Here's the gist: >> This is actually a bug in Luabind as "it assumes that overloaded >> functions >> are bound at instantiation time of templates, but overloaded functions >> are >> bound at definition time, so the luabind" code "only sees the >> luabind::get_const_holder(...) catch all handler. >> >> Our workaround is to include the headers with overloads before including >> the Luabind headers. >> >> Hope this helps. >> >> >> On Fr, 30.11.2007, 08:43, Peter Suwara wrote: >>> We are running to major issues regarding function overloading for the >>> is_user_defined types. >>> >>> This is what is happening: >>> BOOST_STATIC_ASSERT(luabind::detail::is_user_defined<cString>::value) >>> is >>> always failing, even though we have a file that does the following: >>> >>> namespace luabind { >>> >>> namespace converters { >>> >>> yes_t is_user_defined(by_value<cString>); >>> >>> yes_t is_user_defined(by_const_reference<cString>); >>> >>> } >>> } >>> >>> Which means that the following code will fail when attempting to find >>> an >>> appropriate policy, it will pass through and not find any policy to >>> match >>> the user defined type: >>> >>> template<class T, class Direction> >>> >>> struct apply >>> >>> : eval_if<is_user_defined<T>, user_defined_converter<Direction>, >>> eval_if<... >>> >>> Now, in order to fix this situation we include a template >>> specialisation >>> that does the following: >>> >>> template<> >>> >>> struct is_user_defined<cString> { >>> >>> enum {value=true}; >>> >>> }; >>> >>> >>> >>> This creates an interdependency with our codebase and LuaBind. Now does >>> anyone know why the yes_t function overload fails on MetroWerks and are >>> there any other ways to force user defined types for LUA. >>> >>> Thanks, >>> >>> Peter >>> ------------------------------------------------------------------------- >>> SF.Net email is sponsored by: The Future of Linux Business White Paper >>> from Novell. From the desktop to the data center, Linux is going >>> mainstream. Let it simplify your IT future. >>> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4_______________________________________________ >>> luabind-user mailing list >>> lua...@li... >>> https://lists.sourceforge.net/lists/listinfo/luabind-user >>> >> >> >> >> ------------------------------------------------------------------------- >> SF.Net email is sponsored by: The Future of Linux Business White Paper >> from Novell. From the desktop to the data center, Linux is going >> mainstream. Let it simplify your IT future. >> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 >> _______________________________________________ >> luabind-user mailing list >> lua...@li... >> https://lists.sourceforge.net/lists/listinfo/luabind-user >> > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > luabind-user mailing list > lua...@li... > https://lists.sourceforge.net/lists/listinfo/luabind-user > |