Oberon00 / luabind

Luabind is a library that helps you create bindings between C++ and Lua.
http://oberon00.github.io/luabind/
Other
46 stars 13 forks source link

Lua 5.3 bitwise operator support. #45

Open dan-masek opened 3 years ago

dan-masek commented 3 years ago

Add support for Lua 5.3's bitwise operators (and, or, xor, not, shl, shr).

XOR is a bit awkward to use, since its operator is already abused for pow. For example: .def("__bxor", static_cast<std::string(*)(operator_tester const&, operator_tester const&)>(&operator^))

dan-masek commented 3 years ago

OK, compatibility with 5.2 and 5.1....

I suppose it's enough to make the tests conditional based on the lua version used, since having extra metatable entries shouldn't be an issue.

Do you think there's a point in making the support conditional as well?