$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-01-11 19:59:12
AMDG
nicola wrote:
> Hi,
> I have a class modeling a record-based read-only binary file and I have
> written a random access iterator based on iterator_facade to iterate
> over the records. The class looks like this:
>
> class my_binary_file {
>
> <snip>
>
> explicit my_binary_file_iterator(my_binary_file* ff, unsigned int n) : ff_ptr_(ff), rec_num_(n) { }
>
my_binary_file* is *not* const here.
>
> <snip>
>
> };
>
> public:
> typedef my_binary_file_iterator iterator;
>
> iterator begin() *const* { return iterator(this, 0); }
>
this is a pointer to const. The constructor of iterator requires a
pointer to non-const.
In Christ,
Steven Watanabe