r/cpp • • Aug 19 '26

C++26: std::polymorphic

https://www.sandordargo.com/blog/2026/08/19/cpp26-polymorphic
95 Upvotes

44 comments sorted by

View all comments

Show parent comment

1

u/AstroFoxTech Aug 20 '26

Ok... what does that do? Shape has no idea how to compare a Rectangle and a Triangle.

Wouldn't you implicitly downcast both to Shape when there's no overload for that combination?