On Friday, 4 December 2015 at 02:21:12 UTC, Andrei Alexandrescu
wrote:
On 12/03/2015 09:10 PM, Idan Arye wrote:
The complexities of the operations is a property of the data
structure
being used. If each collection type will have it's own set of
method
names based on the complexity of operations on it, we won't be
able to
have templated functions that operate on any kind of
collection(or at
the very least, these functions will be really tedious to
code).
Your premise is right but you reach the negation of the correct
conclusion. -- Andrei
How so? If a singly linked list and a doubly linked list have two
different method names for the same operation, then they cannot
be easily templated.