Closed cr-mitmit closed 2 years ago
any reason that it was not merged ?
any reason that it was not merged ?
Hi,
this feature has already been implemented on c++17
branch, that was recently merged onto the master
one.
A usage example is in a test case: https://github.com/pmed/v8pp/blob/master/test/test_class.cpp#L171-L172
So I'm going to close this pull request.
Patch add support for "External" property functions. This allows adding to v8pp::class_ properties in the form of
T(X const &)
for getters andvoid (X&, T&)
for setters. This makes the following code valid.set("lrprop", v8pp::property( [](const X& x) {return x.var; } ))
which means that when the user in Javascript callsx = new X(); x.lprop
the lambda will get called with unwrapped X as the parameter.