Boost logo

Boost :

From: Kresimir Fresl (fresl_at_[hidden])
Date: 2001-08-27 11:36:51


On Monday 27 August 2001 17:41, Jeremy Siek wrote:

> At one point the default_iterator_policies increment function was static,
> but that was not meant to imply that other policy classes had to make
> their functions static.

Well... yes. But as policy classes in all examples are derived from
default_iterator_policies, nothing implies that those function can be
non-static.

One has to look at the implementation to be sure:

implementation of iterator_adaptor<>::operator++() is

  self& operator++() {
      policies().increment(iter());
      return *this;
   }

If increment() is static, implementation can also be

  self& operator++() {
      Policies::increment(iter());
      return *this;
   }

and currently there's no guaranty that in the next version
the implementation will not change to this one. I think that this
is not just an implementational detail and that the documentation
should clearly state what one can do, and what he/she can't.

Cheers,
fres


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk