On Fri, Feb 24, 2012 at 11:15 AM, Oswin Krause <Oswin.Krause@ruhr-uni-bochum.de> wrote:
Hi,

Thanks for the reply!

>
> http://www.boost.org/doc/libs/1_48_0/libs/iterator/doc/ReadableIterator.html
>
> which states that, for a ReadableIterator i, *i must have a type
> convertible to the iterator's value_type. Further, for iterator_facade,
> the
> type of *i is the iterator's reference type. Therefore, reference must be
> convertible to value_type.
>
> Proxy references are perfectly fine, you just have to ensure they
> interoperate well with (i.e., are convertible to) the iterator's
> value_type.
This sounds good.

So when I exchange my MatrixRow as reference type with

struct MatrixRowProxy:public MatrixRow //lazyness for the example :)
{
   operator Vector(){
       return Vector(*this);
   }
}

and keep everything else untouched, like this:

struct MatrixIterator:
public boost::iterator_facade<
  MatrixIterator,
  Vector,
  boost::random_access_traversal_tag,
  MatrixRowProxy
>{
//as before
};

Everything works? That would be really nice!

Well, the only way to be sure is to try it :)

In this case I am happy and thank you very much for the hint to the
Definition :). This helped me a lot.

Great. Hopefully everything works out. Let us know if it doesn't.

- Jeff