Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

std::back_insert_iterator

15 views
Skip to first unread message

Daniel

unread,
Jan 5, 2017, 10:48:34 AM1/5/17
to
Is there a rationale for why std::back_insert_iterator (and some other output
iterators) declare iterator_traits<It>::value_type,
iterator_traits<It>::difference_type, iterator_traits<It>::pointer, and
iterator_traits<It>::reference to be void, as opposed to picking them up
from the container type?

The context for the question is implementing a template function similar to
std::copy or std::transform, but with different implementations depending on
properties of the value_type written to.

Thanks,
Daniel
0 new messages