nbind icon indicating copy to clipboard operation
nbind copied to clipboard

Add a policy for automatic return value downcasting

Open jjrv opened this issue 9 years ago • 0 comments

When augmenting a C++ class for wrapping like https://github.com/charto/nbind/issues/35#issuecomment-260106802, return values of the non-augmented type should automatically downcast to the augmented type. Configured like:

method(getNode, nbind::Downcast(Node, JS_Node));

Another possible (better?) syntax would be:

NBIND_CLASS(Node) {
  downcast(JS_Node);
}

jjrv avatar Nov 12 '16 14:11 jjrv