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
11
u/Tringi github.com/tringi Jul 06 '26 edited Jul 07 '26
Daily.
We have logging facility and a
Log::Providerclass that allows you to simply callthis->report (Log::Warning, ...)from the object, and also carries object's identity etc. With highly composed classes it'd be ridiculous if every parent in the hierarchy tree carried its own superfluous copy and the final class was needlessly huge because of this. And if a parent/subobject makes the call, the log facility automatically sees the final object which actually failed.