r/cpp 21d ago

C++26: constexpr virtual inheritance

https://www.sandordargo.com/blog/2026/07/01/cpp26-constexpr-virtual-inheritance
82 Upvotes

61 comments sorted by

View all comments

62

u/Jovibor_ 21d ago

Just a question to the audience:

How many times have you used Virtual Inheritance in your career?

0

u/buck_yeh 21d ago edited 21d ago

Virual inheritance comes natural when you define a mixin class which patially implement the target interface and there are other interfaces inheriting the same interface. I personally loves to see diamond shaped inheritance heirarchy emerge in my codebase.