Boost logo

Boost :

From: scleary_at_[hidden]
Date: 2002-11-05 15:21:52


> From: David A. Greene [mailto:greened_at_[hidden]]
>
> <snip>
>
> Nowhere is "decrement" declared or defined in the filter_iterator
> policies yet it can still be used with iterator_adaptor. How
> does this work? Shouldn't the compiler complain that
> iterator_adaptor::operator--() can't find
> filter_iterator_policies::decrement? I could understand if
> operator-- were a template member but it's not. I'm obviously
> missing something. What is it?

Well, it's not really "used" by iterator_adaptor. Since iterator_adaptor is
a template class, the compiler will not instantiate its member functions
unless they are actually used (i.e., called). This is true even though
operator-- is not a template member.

        -Steve


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