Runtime cost of inheritance (without virtuality) in C++?

Viewed 926

In C++ compiled with -O3, does inheritance without virtuality have a cost in terms of :

  • execution time
  • memory

If the answer is yes : why ?

As an example : are MyClass1 and MyClass2 equivalent in terms of performance and memory ?

enter image description here

2 Answers
Related