Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It really won't. The only reason I could think of is if there were a Sphere(Sphere*) constructor, which would be weird, and is also not the case [1]. There is also no reason to use a vector<Sphere*> since Sphere is not part of an inheritance tree; a vector<Sphere> would've done just fine removing the calls to 'new' in that blog post.

Overall, I think this post is on the low end of the quality spectrum. I think the author is a bit confused about things, like they've been doing JS and picked up C++ only recently. Nothing bad about it, but I would do some more reading before posting much of anything.

[1] https://github.com/uds5501/multiple-spheres/blob/master/incl...



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

Search: