Fixed-width strings: Difference between revisions

Jump to navigation Jump to search
m
Line 48: Line 48:
=== Thread safety ===
=== Thread safety ===


Since strings are immutable, they are by definition thread safe. The only unsafe operation if the flattening operation. Therefore, the <tt>flatten()</tt> should look like this:
Since strings are immutable, they are by definition thread safe. The only unsafe operation if the flattening operation. Therefore, the <tt>flatten()</tt> implementation should look like this:
  void String::flatten() {
  void String::flatten() {
   if (0 != this->treeLevel) {
   if (0 != this->treeLevel) {
55

edits

Navigation menu