Why Strings as Classes?

Michiel Helvensteijn nomail at please.com
Thu Aug 28 00:32:55 PDT 2008


Dee Girl wrote:

> I think it is really helpful if you learn STL. Very opening for your mind.
> Because STL does exactly you said. For example there is function
> distance(). It computes distance between iterators in O(n). But if
> iterators are random it works in O(1). So function is as fast as possible.
> And has uniform interface.

Isn't that all we're saying about opIndex()? It retrieves the value from a
list at a certain index in O(n). But if it is an array it works in O(1). So
function is as fast as possible. And has uniform interface.

-- 
Michiel




More information about the Digitalmars-d mailing list