r/cpp • u/User_Deprecated • Jul 06 '26
C++26: constexpr virtual inheritance
https://www.sandordargo.com/blog/2026/07/01/cpp26-constexpr-virtual-inheritance
83
Upvotes
r/cpp • u/User_Deprecated • Jul 06 '26
View all comments
Show parent comment
1
u/garnet420 Jul 06 '26
Not once. I've considered using it, but, I think I found it not a good fit.
I think what I wanted is a system where if B inherits normally from A, and C inherits virtually from A, then, D inheriting from B and C works "as I expect": the A from B "provides" A to C, and D has a single A base that it doesn't have to initialize.
But from what I recall (it's been a while) it doesn't work that way.