Last update July 26, 2013

Doc Comments /
CPPstrings



D Strings vs C++ Strings

As I understood in example with D language you use dictionary which is realized with hash table. But in C++ example you use map which is realized with balanced trees. But hash table is faster than balanced trees.

Comments

In the section "Filling a String", shouldn't the D example use [2..3] instead of [1..3] ?

No, arrays are indexed from 0 so the second element is at 1. The slice is open on the end so [2..3] would just be str[2] = '?'.

A typo "All copy-on-write is is" -> "All copy-on-write [means] is".

In "In­ter­op­er­abil­ity With C String Syn­tax", the second code sample is D and should be highlighted for D syntax.

These could be submitted as a bug: http://d.puremagic.com/issues/

Links

Corresponding page in the D Specification

FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: July 26, 2013 19:07 (diff))