> I insist that C++ is paranoic;I cant see why one shoud be able to
> but not:
> this is painful
For a function void f(char*) one should NOT be able to write f("123")
as that involves passing a pointer to const data to a function that
accepts a pointer to non-const data. Unfortunately, for backwards
compatibility with C and all the legacy code out there, this one
specific kind of const abuse was deemed necessary. This introduces an
unfortunate logical inconsistency that you are seeing as paranoia.
There are two options to fix the logic:
1. Make everything consistent by removing the distinction between T*
and const T*. That would be mad.
2. Make everything consistent by removing the specific allowed
conversion from string literal to non-const char*. That would be great,
except for the backwards compatibility and legacy code issue. So the
standard does the next best thing and deprecates that conversion so
that it can be removed if and when it is decided that the backwards
compatibility problem is small enough to live with.
So, this inconsistency is not paranoia, it is just an artifact of C++'s
history. There is no reason that any of the C++ code you write today
need make use of the deprecated feature.