virtual-inheritance
How to ensure that the assignment operator on a virtual base class is called only once?
I\'m using virtual inheritance as in the typical diamond problem: A (virtual) /\\ (virtual) BC \\/ D I\'m implementing a method named \"deep_copy_from\" in every class (but it could be the assignme[详细]
2023-01-28 21:24 分类:问答Virtual inheritance doesn't break static composition?
I was working the last 5 years with the assumption that virtual inheri开发者_开发问答tance breaks static composition.[详细]
2023-01-27 19:48 分类:问答C++ virtual inheritace and typecasting/copy constructor confusion
I have the code below: class A { }; class B: public virtual A { public: B() { cerr << \"B()\"; } 开发者_开发技巧B(const A& a)[详细]
2023-01-17 12:38 分类:问答C++ cannot convert from base A to derived type B via virtual base A
I have four classes: class A {}; class B : virtual public A {}; class C : vi开发者_如何学JAVArtual public A {};[详细]
2023-01-16 23:05 分类:问答Calling a virtual base class's overloaded constructor
Is there a (practical) way to by-pass the normal (virtual) constructor calling order? Example: class A {[详细]
2023-01-12 06:31 分类:问答is base class list the right place to indicate virtual inheritance?
I have never seen a class used as virtual and nonvirtual base (i.e. if some class is intended to be an ancestor then we usually know in advance about type of inheritance - virtual or nonvirtual).[详细]
2023-01-10 19:19 分类:问答Where is the "virtual" keyword necessary in a complex multiple inheritance hierarchy?
I understand the basics of C++ virtual inheritance.However, I\'m confused about where exactly I need to use the virtual keyword with a complex class hierarchy.For example, suppose I have the following[详细]
2023-01-10 14:06 分类:问答Virtual tables and virtual pointers for multiple virtual inheritance and type casting
I am little confused about vptr and representation of objects in the memory, and hope you can help me understand the matter better.[详细]
2023-01-09 04:48 分类:问答Method resolution order in C++
Consider the following class hierarchy: base class Object with a virtual method foo() an arbitrary hierarchy with multiple inheritance (virtual and non-virtual); each class is a subtype of Object; s[详细]
2023-01-08 23:33 分类:问答Can't cast a class with multiple inheritance
I am trying to refactor some code while leaving existing functionality in tact. I\'m having trouble casting a pointer to an object into a base interface and then getting the derived class out later. T[详细]
2022-12-31 19:43 分类:问答