I’m using Luabind to integrate LUA into one of my projects, and the following thing struck me as odd (I’m a self taught beginner)
template <class C, class D, class GetPolicies, class SetPolicies>
class_& def_readwrite(
const char* name
, D C::*mem_ptr
, GetPolicies const& get_policies
, SetPolicies const& set_policies
)
this function takes a string and a pointer to a member field, I get that, what confuses me is the order here.
D C::*mem_ptr
I expected D::C *, since “&foo::bar” into “foo bar:: *” …looks very odd to me.
What is the logic behind this?
if you substitute
DandCwith actual types, it makes sense: