std.string and std.algorithm: what to do?

dsimcha dsimcha at yahoo.com
Thu May 14 08:22:55 PDT 2009


== Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s article
> I'm not sure what needs to be done about the combo string + algorithm.
> There's quite some overlap, and also functions that have the same name
> in both modules (e.g. find()), which forces you to disambiguate.
> Should std.algorithm automatically recognize strings and proceed
> accordingly, should it just consider them straight arrays and leave
> everything else to std.string (risky!), or refuse to handle strings?

I like the idea of automatically specializing on strings, at least on the surface.
 It's less to remember for the programmer, less annoying naming collisions, and
stuff "just works".  You get your generic std.algorithm stuff when you need it and
your more optimized/variable length character encoding stuff when you need it
without having to explicitly specify which one you want.



More information about the Digitalmars-d mailing list