virtual-functions
Is it ever "moral" to override a nonvirtual function? [closed]
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari[详细]
2023-02-16 07:55 分类:问答Can I execute a "variable statements" within a function and without defines?
I am facing a problem that I cannot see how it is solvable without #defines or incurring a performance impact although I am sure that someone can point me to a solution.[详细]
2023-02-15 05:25 分类:问答Virtual Functions: Iterating over a vector<Base Class> that is populated with subclass objects
Short Description: I am iterating over a vector calling a virtual function on every object in the vector in order to execute a sequence of actions.The vector is of the base class as is the iterator.Al[详细]
2023-02-15 02:46 分类:问答Why bother with virtual functions in c++?
This is not a question about how they work and declared, this I think is pretty much clear to me. The question is about why to implement this?[详细]
2023-02-14 23:18 分类:问答C++ virtual function undefined at link time - why?
I\'m having a bit of trouble using virtual functions in C++, and I might be misusing them in a constructor. The problem is that when linking a component lib (written by me) into my final executable, a[详细]
2023-02-10 07:27 分类:问答Why does g++ store class names in the compiled binary?
I noticed that If I run strings on my program which was compiled by g++ the output contains the names of various classes that it uses.[详细]
2023-02-09 19:08 分类:问答C++ "virtual" keyword for functions in derived classes. Is it necessary?
With the struct definition given below... struct A { virtual void hello() = 0; }; Approach #1: struct B : public A {[详细]
2023-02-09 01:28 分类:问答Question with virtual functions
I have two classes: class x { public: virtual void hello() { std::cout << \"x\" << std::endl;[详细]
2023-02-07 00:31 分类:问答Ways to detect whether a C++ virtual function has been redefined in a derived class
In brief: From a C++ base-class pointer which points to an instance of a derived class, how can one determine at run-time whether a non-pure virtual function (with an implementation in the base class)[详细]
2023-02-05 08:54 分类:问答C++ virtual function return type
Is开发者_开发百科 it possible for an inherited class to implement a virtual function with a different return type (not using a template as return)?In some cases, yes, it is legal for a derived class t[详细]
2023-02-04 06:14 分类:问答