KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This method: bool Point::Intersects(const Line& line) const { return (line.ContainsPoint(*this, false)); } causes this error: cannot convert 'this' pointer from 'const Line' to 'Line &' This change: bool Point::Intersects(const Line& line) const { return const_cast<Line&>(line).ContainsPoint(*this, false); } fixes the error, but doesn't seem the right way to fix the issue. Why is the original method considered an error? If it helps, ContainsPoint(const Point& point, bool isInfinite) is non-const and all methods it calls are non-const as well.
Tags (comma-separated)
Save Edits
Cancel