Hi All -
I'm just getting started with D, and I'm liking it so far, thanks to
everyone for all the hard work.
I was doing some string work and found that toupper() is failing on my char
array, although tolower() does work. E.g. these two examples:
s ~= "Hello";
auto s_low = s.tolower();
auto s_up = s.toupper();
The tolower works but the toupper fails (error at the bottom of this message).
For reference I'm using 2.048.
I noticed that tolower() and toupper() have different implementations, although
there was a section commented out in tolower() that looks just like the toupper
I converted toupper() to use essentially the same code as tolower() and all
seems to work well. e.g.
S toupper(S)(S s) if (isSomeString!S)
foreach (i, dchar c; s)
if (!std.uni.isUniLower(c)) continue;
auto result = s[0.. i].dup;
foreach (dchar c; s[i .. $])
c = std.uni.toUniUpper(c);
result ~= c;
return cast(S) result;
Perhaps toupper() was in the midst of being changed when this snapshot of the
code was made? Anyway, I thought I would bring it to your attention.
Erin Scott Sheldon
cannot implicitly convert expression (changed ?
cast(const(char))assumeUnique(r) : s) of type const(char) to char
template instance std.string.toupper!(char) error instantiating