I have two C++ classes. A method on one of them is supposed to return a new instance of b. I tried to follow the pattern described here:
// foo.cc
const int argc = 3;
Local<Value> argv[argc] = { NanNew(*arr), NanNew(sw), NanNew(sh) };
Local<Function> cons = Local<Function>::New(Isolate::GetCurrent(), Bar::constructor);
NanReturnValue(cons->NewInstance(argc, argv));
but then:
No instance of overloaded function "v8::Local<T>::New [with T=v8::Function]" matches the argument list. Argument types are: (v8:Isolate *(), v8::Persistent<v8::FunctionTemplate, v8::NonCopyablePersistentTraits<V8::Functiontemplate>>)
I can't find an example of this pattern in the io.js source, and the closest google result is an unanswered SO question. I found one example where a factory method was added to Bar but that seems like it should be unnecessary. Any tips on the pattern to use here? Thanks.
I have two C++ classes. A method on one of them is supposed to return a new instance of
b. I tried to follow the pattern described here:but then:
I can't find an example of this pattern in the io.js source, and the closest google result is an unanswered SO question. I found one example where a factory method was added to
Barbut that seems like it should be unnecessary. Any tips on the pattern to use here? Thanks.