virtual-functions
Calling an overridden method from base constructor
We have a class like this: class LogAnalyzer { protected IExtensionManager manager; publicLogAnalyzer() { GetManager();[详细]
2023-02-02 04:37 分类:问答Simultaneous private and public inheritance in C++
Suppose a class Y publicly inherits a class X. Is it possible for a class Z to privately inherit Y while publicly inheriting X?[详细]
2023-02-01 05:20 分类:问答C++ virtual functions implementation outside the class
I am new to C++. While trying sample polymorphism code, I found that base class virtual function definition in derived class is possible only when defined within the derived class or outside with decl[详细]
2023-01-31 09:22 分类:问答C++: fighting polymorphism overhead
I know that polymorphism can add a noticeable overhead. Calling a virtual function is slower than calling a non-virtual one. (All my experience is about GCC, but I think/heard that this is true for an[详细]
2023-01-23 23:38 分类:问答Can child templates stored in a base class array, use an overloaded virtual function?
In hope to simplify a homework problem dealing with inheritance, I thought it might be better to use polymorphism to accomplish the task.It isn\'t required, but makes much more sense if possible.I am,[详细]
2023-01-21 04:59 分类:问答Can I override an overload of an operator and return a different type?
class A{ public: virtual char &operator[](int); protected: .. }; class B:A{ public: A* &operator[](int);[详细]
2023-01-20 00:53 分类:问答No "add esp,4" for virtual functions returning std::string
I\'ve been looking at DynObj and decided to do my own experimentation with vftables.I\'m working with Visual Studio 2010 and created a console main that instantiates an object with a virtual functi开发[详细]
2023-01-19 12:30 分类:问答How can I ensure that a class has no virtual methods?
I have a class whose objects are used in shared memory. Therefore, I must be sure that they do not have virtual methods (which crash the progr开发者_Python百科am when called via vtable).[详细]
2023-01-15 22:42 分类:问答Overload resolution and virtual methods
Consider the following code (it\'s a little long, but hopefully you can follow): class A { } class B :开发者_JAVA百科 A[详细]
2023-01-15 04:29 分类:问答Non virtual methods in Java
Just starting to use Java. I find a lot of similarities with .NET, but I see that all methods in Java are virtual by default.[详细]
2023-01-14 23:26 分类:问答