1

I'm binding a lot of classes to Lua using sol library and I wanted to make a macro that would make bindings consistent (same function name in Lua and C++). Here is an example of binding:

auto bind = state_->new_usertype<Class1>("Class1");
bind["Function1"] = &Class1::Function1;
bind["Function2"] = &Class1::Function2;
bind["Function3"] = &Class1::Function3;
bind["Function4"] = &Class1::Function4;

And I would like to have something like this expanding to example above:

SOL_BIND(Class1,
    Function1
    Function2,
    Function3,
    Function4)

How would I go about doing that? If this is even possible?

GeeRoy
  • 11
  • 1
  • 1
    Looks like a duplicate of https://stackoverflow.com/questions/5957679/is-there-a-way-to-use-c-preprocessor-stringification-on-variadic-macro-argumen – MSalters Oct 29 '21 at 12:16

0 Answers0