From: Ian McCulloch (ianmcc_at_[hidden])
Date: 2005-06-24 13:52:16
David Abrahams wrote:
> Ian McCulloch <ianmcc_at_[hidden]> writes:
>> The containers have some different behaviour, but then so do
>> vector/deque/list. That doesn't stop us writing generic code,
> Wanna bet? When was the last time you wrote a generic function
> designed to work on "any container?"
Heh. Well, simple functions work fine (eg, forwarding to an iterator-based
algorithm :-). But it would be much simpler in this case, because we have
STATIC_ASSERT(is_noalias<T>) and enable_if<is_noalias<T> >. If we could do
that for containers, with metafunctions like
is_iterator_invalidated_on_insert<T> and so on, writing complex generic
functions for containers would be easier.