[Issue 10379] std.string.translate (and others) for a Range of characters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 17 16:38:21 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10379


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-06-17 16:38:19 PDT ---
I could imagine a generic version of it put into std.algorithm (where the
translate hash table can have any Value type but the Key type would have to be
the ElementType of the range), for example:

-----
string[int] table = [1 : "one", 2 : "two"];
auto inputRange = ...;  // some integer range
inputRange.translate(table);
-----

I'm not sure about the use-cases though.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list