Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-01-12 16:34:16


AMDG

nicola wrote:
> There is more than that, however: as you can see in my original post,
> get_record() and seekg() are not const and that is a problem
> because they are invoked by dereference(). I can compile successfully if
> I const-qualify them, but this is not correct in my opinion.
> The fact is, they do change the state of the object in a visible way.
>

OK. Since begin and end return handles to the class that allow its
state to change
they should not be const.

If they absolutely need to be const then you need to reset the the seek
position after you use it.
You can create private const versions get_record and seekg for this purpose.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net