Yes. It's not "Read only", it's more "input", really. Normally, you
really rarely want to use plain CString. You want that when you want
to pass it as an input (by value), and you want to modify it inside,
Although probably a rare case, but in a multithreaded app, the
difference between CString and CString const & could be important.
e.g.
// Global resource:
CString csName("Albert");
// Thread 1:
...
DoSomething(csName); // line 1
...
// Thread 2:
...
csName = "Alex"; // line 2
...
Now consider if DoSomething is defined as
void DoSomething(CString csFriend)
{
...
cout << csFriend<< endl; // line 3
}
Now consider line1 begins execution, and the name "Albert" is copied
into the csFriend argument. Then control switches to thread 2 and
line 2 is executed. Then control goes back to thread 1 and line 3 is
executed. "Albert" will be printed.
If on the other hand DoSomething is defined with reference:
void DoSomething(CString const & csFriend)
{
...
cout << csFriend<< endl; // line 3
}
With the same serious of executions steps, "Alex" would be printed.
Depending on what you are trying to do, either one could be the
desired behavior.
attempting to read/write a shared datum from multiple threads. That
does not work in a general case. Your example just muddies the waters
and tries to apply them to a CString&.