English 中文(简体)
C++级遗留的建筑构造
原标题:Can t call correct constructor on struct inherited from C++ class
最佳回答

There is no constructor defined in V8Context, so only the implicit copy constructor appears as an option. You need to explicitly define a constructor in V8Context that forwards the v8::Persistent<T> argument to its base class.

问题回答

在C++中继承了建筑商(尽管在C++11中有一些穿过功能),因此,你不得不在上写你的自己的建筑商,该编码明确称为适当的基类建筑商。

根据我的理解,new V8Context (...)v8:Handle<T> s Constructionor.

<代码>new V8Context(......)将仅指在V8Context/code>上宣布的建筑商;建筑商不继承。 你们需要增加一个,例如:

V8Context(v8::Handle<v8::Context> const & handle) : 
    v8::Handle<v8::Context>(handle) 
{}

<代码>new V8Context(...).n t calls a Constructionor from v8:Handle<T>, but a Constructionor from V8Context。 由于你对其中的字塔作了界定,只有违约的建筑商和复印件建筑商才能使用(建筑商是可继承的)。 因此,它试图打上影印机,并且由于这一论点可能变成了<编码>V8Context。 为了解决你的问题,你需要增加一个适当的构造者,以<代码>V8Context,该编码将把论点提交基建商(根据你的论点,并非确切的编号,而是类似的话):

struct V8Context : public v8::Handle<v8::Context> {
  V8Context(const v8::Handle<v8::Context>& handle): v8::Handle<v8::Context>(handle) {}
};

www.un.org/Depts/DGACM/index_french.htm

  • the copy constructor which is synthesized whenever it is needed and not explicitly declared or made impossible (e.g. by deriving from a class without a copy constructor). This constructor take a V8Cintext as argument.
  • the default constructor which is synthesized when needed, when there is no explicit constructor, and all members and bases can be default constructed. Thos constructor has no arguments.

看来,你试图通过与复制商签名相对应的那类。 如果你想要使用,就需要明确提供相应的建筑。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签