|
Ublas : |
From: David Abrahams (dave_at_[hidden])
Date: 2005-06-25 19:39:13
Ian McCulloch <ianmcc_at_[hidden]> writes:
> 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 :-).
That's iterators, which have a very well organized and well-defined
taxonomy of concepts. There's no such thing for containers.
> 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.
But still very, very messy.
-- Dave Abrahams Boost Consulting www.boost-consulting.com