vinniefalco/LuaBridge

Calling proxy methods on const pointers

rpatters1 opened this issue · 0 comments

I just spent the better part of a day trying to figure out why a proxy method I had added to a class was not there on some instances of the class. I finally tracked it down to the fact that the pointer to the instance was a const pointer in C++ but the proxy method did not take a const pointer as its first parameter.

I can see some value in this if the programmer knows about this situation, but I can imagine many might give up in frustration before they figured it out. It's worth considering whether this would be better as a runtime error that produced a useful error message. At the very least, clarification in the documentation would be useful. If you are interested, I don't mind modifying the docs to call out this issue in a larger way.