decimad / luabind-deboostified

Create Lua bindings for your C++ code easily - my improvements
http://www.vrac.iastate.edu/vancegroup/docs/luabind/
Other
70 stars 27 forks source link

pure_out_value with discard_result #8

Closed atom0s closed 7 years ago

atom0s commented 10 years ago

In the standard Luabind I can def a function with both of these such as:

.def( "GetString",      &IConfiguration::GetString, luabind::pure_out_value(_4) + luabind::discard_result )

With the boostless version you provide, I cannot seem to find a way to make both of these values work.

Is there a new method of handling both? At the moment I am trying the similar format of:

.def("GetConfigString", &IScriptManager::GetConfigString, pure_out_value<4>() + discard_result())

But this does not work.

ltjax commented 9 years ago

I'm not sure this was really ported from the with-boost version, but it seems like some form of using meta::join is now required for this, since policies are now, as the readme says, lists with one element.

Like this:

.def("GetConfigString", &IScriptManager::GetConfigString, meta::join<pure_out_value<4>, discard_result>())
atom0s commented 9 years ago

I landed up writing wrappers for Lua to use the configuration stuff I showed above. Not a huge deal now since it was a while back. If I decide to do any other adjustments I'll check out your suggestion though, thanks.

decimad commented 7 years ago

Closing this, ltjax pointed to the correct construct for policy aggregation.