Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-02 15:36:49

"Thorsten Ottosen" <nesotto_at_[hidden]> writes:

> "Alisdair Meredith" <alisdair.meredith_at_[hidden]> wrote in message
>> Thorsten Ottosen wrote:
>> > 2. many standard algorithms take a single output iterator as an
> argument.
>> > Currently the argument for output must be a container. Should
>> > it be posible to specify an iterator here too?
>> Absolutely! Not all iterators belong to containers eg ostream_iterator
> I see your point. Does anyone have a nice idea of how to detect when the
> template argument is an iterator?

Sadly, there is no reliable way. The closest thing I can imagine is
to use SFINAE to check that iterator_traits<T> has valid types, and
that the types are consistent with the iterator requirements.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at