Skip to main content
3 events
when toggle format what by license comment
Jun 8, 2016 at 19:54 comment added Jules This isn't quite what the question was asking, though, which was for a way to specify that the return type extends two identified superclasses at the same time, i.e. class Base1{}; class Base2{}; class Derived1 : public Base1, public Base2 {}; class Derived2 : public Base1, public Base2 {}... now what type can we specify that allows returning either Derived1 or Derived2 but neither Base1 nor Base2 directly?
Jul 30, 2015 at 1:40 comment added Deduplicator And of course one can use an any or a variant type, like the templates boost provides. Thus, the restriction doesn't stay.
Feb 24, 2012 at 16:21 history answered David Thornley CC BY-SA 3.0