读书人

土耳其文《d编程》range 通译 二

发布时间: 2012-12-18 12:43:41 作者: rapoo

土耳其文《d编程》range 翻译 二
As you can see, that output does not match what we have seen in the Characters and Strings chapters. Since the elements of string and wstring are char and whar respectively, one might expect to see UTF code units in the previous output.

As a reminder, let's use the following function to see how different the use of strings as ranges is different from using them as arrays:

void printElements(T)(T str)
{
for (int i = 0; i != str.length; ++i) {
write(' ', str[i]);
}

writeln();
}

// ...

printElements("abc?deé

读书人网 >编程

热点推荐