Hacker News new | past | comments | ask | show | jobs | submit login

One way of getting symmetricity in C++ using the first approach is to do something like this:

if (a->intersect(b)) return; if (b->intersect(a)) return; general_intersect(a, b);

(making the base version return false, and adding return true to any overrides)

This way you would only need to add the Ellipse/HyperFrob specialization to the HyperFrob class.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: