Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

rt.aApply

This code handles decoding UTF strings for foreach loops. There are 6 combinations of conversions between char, wchar, and dchar, and 2 of each of those.
Authors:
Walter Bright
alias dg_t = int delegate(void*);
int _aApplywd1(in wchar[] aa, dg_t dg);
int _aApplycw1(in char[] aa, dg_t dg);
int _aApplywc1(in wchar[] aa, dg_t dg);
int _aApplydc1(in dchar[] aa, dg_t dg);
int _aApplydw1(in dchar[] aa, dg_t dg);
alias dg2_t = int delegate(void*, void*);
int _aApplywd2(in wchar[] aa, dg2_t dg);
int _aApplycw2(in char[] aa, dg2_t dg);
int _aApplywc2(in wchar[] aa, dg2_t dg);
int _aApplydc2(in dchar[] aa, dg2_t dg);
int _aApplydw2(in dchar[] aa, dg2_t dg);