-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Closed
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.questionIssues that look for answers.Issues that look for answers.
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.questionIssues that look for answers.Issues that look for answers.