4 ms·
There are user-defined string literals (1) in C++11. They can do pretty much whatever you want. Also, using templates it is trivial to distinguish between arra
by humanrebar 12y ago
There are user-defined string literals (1) in C++11. They can do pretty much whatever you want.
Also, using templates it is trivial to distinguish between arrays of characters and character pointers.
Finally, there is a proposal for a string_view (2), which could be used to represent string literals, no copies needed.
(1) http://en.cppreference.com/w/cpp/language/user_literal http://en.cppreference.com/w/cpp/language/user_literal
(2) http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3609.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n360...