summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGeoff Liu <cangming.liu@gmail.com>2014-12-01 21:39:49 -0700
committerGeoff Liu <cangming.liu@gmail.com>2014-12-01 21:39:49 -0700
commit8ea39ded5c746628ae74ad3706752410de5273cd (patch)
treef5fe09d28a0229dccef796a65333e78558f9fa38
parente1610bf1a93550740072832cff1c647b0869a993 (diff)
Reassignment to reference doesn't cause error
-rw-r--r--c++.html.markdown2
1 files changed, 1 insertions, 1 deletions
diff --git a/c++.html.markdown b/c++.html.markdown
index 9f357b08..d81ca4fc 100644
--- a/c++.html.markdown
+++ b/c++.html.markdown
@@ -238,7 +238,7 @@ string& fooRef = foo; // This creates a reference to foo.
fooRef += ". Hi!"; // Modifies foo through the reference
cout << fooRef; // Prints "I am foo. Hi!"
-fooRef = bar; // Error: references cannot be reassigned.
+fooRef = bar; // Doesn't reassign `fooRef`. This is the same as `foo = bar`
const string& barRef = bar; // Create a const reference to bar.
// Like C, const values (and pointers and references) cannot be modified.