I was reading through <poly.hpp> source on ASL web .
1. There are wrong comments on lines 128, 170 - they accompany friend function, but mention "this": "// Precondition : this->type_info() == x.type_info()" --> solution: "this" should be "x" and "x" should be "y" (this comment was probably simply copy/pasted from above cases, where it is correct)
2. For the 2 functions mentioned above and other ones where there is a comment about a precondition - why not add an "assert(this->type_info() == x.type_info());" to the code? (I am still trying to figure the code out, but asserting preconditions looks like the right thing to do in debug builds).
Log in to post a comment.