Top "Virtual-functions" questions

In object-oriented programming, a virtual function or virtual method is a function or method whose behaviour can be overridden within an inheriting class by a function with the same signature.

Where do "pure virtual function call" crashes come from?

I sometimes notice programs that crash on my computer with the error: "pure virtual function call". How do these programs …

c++ polymorphism virtual-functions pure-virtual
How to implement virtual methods in Python?

I know virtual methods from PHP or Java. How can they be implemented in Python? Or have I to define …

python virtual-functions
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 { virtual void hello() { ... } }; Approach #2: …

c++ overriding virtual-functions
Are inline virtual functions really a non-sense?

I got this question when I received a code review comment saying virtual functions need not be inline. I thought …

c++ inline virtual-functions
Why are C# interface methods not declared abstract or virtual?

C# methods in interfaces are declared without using the virtual keyword, and overridden in the derived class without using the …

c# methods interface abstract virtual-functions
virtual assignment operator C++

Assignment Operator in C++ can be made virtual. Why is it required? Can we make other operators virtual too?

c++ operator-overloading virtual virtual-functions
Virtual functions and performance - C++

In my class design, I use abstract classes and virtual functions extensively. I had a feeling that virtual functions affects …

c++ performance optimization virtual-functions
Can we have a static virtual functions? If not, then WHY?

Possible Duplicate: C++ static virtual members? Can we have a static virtual functions? If not, then WHY? class X { public: …

c++ static-methods virtual-functions
g++ "because the following virtual functions are pure" with abstract base class

Here is my example code which produces the error: struct Impl { int data_size_; int find(int var){return 0;} int …

c++ polymorphism virtual-functions diamond-problem
How are virtual functions and vtable implemented?

We all know what virtual functions are in C++, but how are they implemented at a deep level? Can the …

c++ polymorphism virtual-functions vtable