What's C's biggest mistake?

bearophile bearophileHUGS at lycos.com
Fri Jan 1 12:37:44 PST 2010


Walter Bright:
> 3. The glaring fact that std::vector<char> and std::string are different 
> suggests something is still wrong.

In an array/vector you want O(1) access time to all items (ignoring RAM-cache access/transfer delays), while in a string with variable-width Unicode encoding that can be hard to do. So they look like two different data structures.

Bye,
bearophile



More information about the Digitalmars-d mailing list