
20 Nov
2017
20 Nov
'17
3:43 p.m.
Richard Hodges wrote:
It seems to me that the previous name of cloned_ptr is a better choice.
_value is fine IMO. You can have vector<polymorphic_value<Shape>> v; and then v.push_back( Circle(10) ); v.push_back( Ellipse(10, 15) ); v.push_back( Square(11) ); I would drop the U* constructor though. It's a remnant of the times this was called a pointer. U&& is all that's needed. It's unfortunate we have to use -> instead of . but that's what's available.