Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding property setters separately #265

Open
rpatters1 opened this issue Oct 3, 2021 · 0 comments
Open

Adding property setters separately #265

rpatters1 opened this issue Oct 3, 2021 · 0 comments

Comments

@rpatters1
Copy link
Contributor

rpatters1 commented Oct 3, 2021

I have a need to add property setters separately from getters. This is not necessarily because I want write-only properties, though that would be a potential consequence of changing LuaBridge. It simply is the case that the constexpr code I'm working on makes it extremely difficult or impossible to know the getter and setter addresses at the same time (at least on the Visual Studio 2019 platform).

I hacked the LuaBridge source code to do this, by adding an addPropertySetter function that only takes a setter. It seemed to be trivially straightforward, but I am not an expert on LuaBridge source code. Is this something the broader community sees a need for? Has it been done in any of the other forks?

EDIT: Originally I used an overload of addProperty that only took a setter. But I realized that made it too easy to add a setter accidentally instead of a getter. So instead I made it an explicit function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant