Re: std::move and vc10: bug or misunderstanding?
On 5/26/2013 4:55 PM, Paavo Helde wrote:
CString is not standard
As majority of code we work with.
not portable,
I did port it to several systems in the past without problems or a
workload worth mentioning -- and majority of code we write is not
intended for porting in the first place. for code written in VS it
applies even more.
decays automatically into const char* pointer,
What is a great feature that makes the std:: version crappy to use with
real-life environment. Like WIN32, someone using VS is pretty likely to
target. And if you deal with code that originated in C, you can replace
char[] buffers without messing up the client code. With std:: version it
requires much work and result in code infested with all those c_str()
noise.
I understand why the standard body did not want that implicit
conversion, but I honestly do not understand most actual users to speak
against. I work with all kind of implicit converting things for more
than two decades and related accidents are still on the theroetic field.
And I keep asking evidence to the contrary and getting silence or
more theory. Certainly I can construct a broken example but it just
fails to happen in practice, and easy to spot on a review. (Or maybe
accident needs some pretty louse policy on pointer usage in general --
for that case I'd guess the implicit conversion will not be a
considerable problem compared to that ;-)
cannot really hold utf-8, etc.
Err, what? Please explain this one.
What's so sensible about it?
It doesn't have hundreds of unneeded member functions, while lacking the
few that are actually needed and used. Like:
- Format !!!
- the trim family
- make upper and lowercase
- buffer interface with Getbuffer/releasebuffer, so I can set the
content from file, resource, WIN32 API call without using a vector<char>
and then construct a string in the next step
Also it is does COW fine in the MT environment as the interface got not
overlooked. It's convenient in general and is a life-saver for some
special cases with massive sharing.
CString was created by actual engineering, thinking use cases for a
string class, not some monster to demonstrate that you can use it with
generic algorithms in theory.
For the opposite question, why could in make sense to use std::string I
have a single bullet, "it is standard". What makes it a widespread
liability. :-o