I have a class that is like
class HtmlRover
{
public:
HtmlRover(const std::string::const_iterator &, const std::string::const_iterator &);
~HtmlRover();
// ...
private:
/...
std::string::const_iterator _curIter;
const std::string::const_iterator _offend;
/...
};
and my compiler is complaining about my instantiation of _offend
in the implementation of the constructor:
HtmlRover::HtmlRover(const std::string::const_iterator & it1, const std::string::const_iterator & it2)
{
_curIter = it1;
_offend = it2;
}
It says
No vaiable overload "="
Now I understand this probably has something to do with a const
variable being set to a reference of a variable, but then again the reference is also const
, so what's the problem? I know that const
variables cannot exist without being initialized, but that also should not be a problem since _offend
is getting initialized right when an HtmlRover
object is initialized.