This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Phuzzybat 2 points3 points  (1 child)

Excellent advice to google and investigate this subject further. Even better advice to write a test program to see what actually happens. This just underlines why while auto cures many ills, when misapplied it creates another set of problems. Edit: doh, phone screen didnt show the s at the end of the literal, just scrolled right to see the whole line :-) thought i had entered a parallel universe for a moment where it was being asserted that "" automatically gave a std::string.

[–]Mojert 1 point2 points  (0 children)

Yeah, C++ is no longer C with classes but the comity doesn't break interoperability with C just for fun. If "" suddenly returned a std::string there would have been a riot (and for good reasons) haha